<?xml version="1.0" encoding="windows-1250"?>
<gxsl:stylesheet xmlns:gxsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias" xml:space="default">
  <gxsl:namespace-alias stylesheet-prefix="xsl" result-prefix="gxsl"/>
  <gxsl:output method="xml" encoding="windows-1250" cdata-section-elements="gxsl:comment" indent="yes"/>

  <gxsl:include href="utils.xsl"/>

  <gxsl:param name="cvincludepage"/>
  <gxsl:param name="cvinclude" select="$cvincludepage/.."/>
  <gxsl:param name="lang">cs</gxsl:param>

  <gxsl:template match="/">
    <xsl:stylesheet version="1.0">
      <xsl:output method="html" indent="no" encoding="windows-1250"/>
      <gxsl:apply-templates select="$cvinclude"/>
    </xsl:stylesheet>
  </gxsl:template>

  <gxsl:template match="CVInclude">
    <gxsl:variable name="dict" select="document('dictionary.xml')/Translation"/>

    <xsl:template name="buildOptions">
      <xsl:param name="class">editlist_input_field</xsl:param>
      <xsl:param name="formcode"/>
      <xsl:param name="val">!@#</xsl:param>
      <xsl:param name="onchange">itemchanged(this.form)</xsl:param>

      <xsl:element name="select">
        <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
        <xsl:attribute name="name"><xsl:value-of select="$formcode"/></xsl:attribute>
        <xsl:attribute name="id"><xsl:value-of select="$formcode"/></xsl:attribute>
        <xsl:attribute name="onchange"><xsl:value-of select="$onchange"/></xsl:attribute>
        <xsl:if test="$val!='!@#' and not(/DPOutput/out/Enumerations/Enumeration[Name=$formcode]/Items/Item/Value=$val)">
          <option value="" style="color:red" selected="true">? <xsl:value-of select="$val"/></option>
        </xsl:if>
        <option value="">---<gxsl:value-of select="$dict/Text[@tid='choose_one']/Value[@lang=$lang]"/>---</option>
        <xsl:for-each select="/DPOutput/out/Enumerations/Enumeration[Name=$formcode]/Items/Item">
          <xsl:element name="option">
            <xsl:attribute name="value"><xsl:value-of select="Value"/></xsl:attribute>
            <xsl:if test="$val=Value"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
            <xsl:if test="Flags/Flag[@name='Direction']='output' or Flags/Flag[@name='Direction']='reply'">&lt; </xsl:if>
            <xsl:if test="Flags/Flag[@name='Direction']='input' or Flags/Flag[@name='Direction']='request'">&gt; </xsl:if>
            <xsl:if test="Flags/Flag[@name='Direction']='reqreply'">&lt;&gt; </xsl:if>
            <xsl:value-of select="Value"/>
          </xsl:element>
        </xsl:for-each>
      </xsl:element>
    </xsl:template>

    <xsl:template match="Enumerations"/>

    <xsl:template match="DPList">

      <xsl:if test="@selectfun and not(@selectfun='')">
        <script language="JavaScript" type="text/javascript">
        <xsl:comment>
        <![CDATA[
          function select(key,]]><gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@basegroup='true' and @onlabel='1']">label<gxsl:value-of select="position()"/>,</gxsl:for-each>dummy)<![CDATA[
          {
              window.opener.]]><xsl:value-of select="@selectfun"/>(key, <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@basegroup='true' and @onlabel='1']">label<gxsl:value-of select="position()"/>,</gxsl:for-each>dummy);<![CDATA[
              top.close();
          }

          function multiselect(keys) {
              window.opener.]]><xsl:value-of select="@selectfun"/><![CDATA[multi(keys);
              top.close();
          }
          ]]>
          //</xsl:comment>
        </script>
      </xsl:if>

      <xsl:choose>
        <xsl:when test="@selectfun and @selectfun!='' and @selectfun!='no'">
          <script language="JavaScript" type="text/javascript">
          <xsl:comment>
          <![CDATA[
            function isSelectfun() {
              return true;
            }
            ]]>
            //</xsl:comment>
          </script>
        </xsl:when>
        <xsl:otherwise>
          <script language="JavaScript" type="text/javascript">
          <xsl:comment>
          <![CDATA[
            function isSelectfun() {
              return false;
            }
            ]]>
            //</xsl:comment>
          </script>
        </xsl:otherwise>
      </xsl:choose>

      <p>
      <font size="+1"><b>
        <gxsl:choose>
          <gxsl:when test="CVITitles/CVITitle">
            <gxsl:value-of select="CVITitles/CVITitle[@id_cttype='listtitle']/Title"/>
          </gxsl:when>
          <gxsl:otherwise><gxsl:value-of select="@concept"/> List</gxsl:otherwise>
        </gxsl:choose>

      </b></font><br/>
      <xsl:text disable-output-escaping="yes">
      <gxsl:if test="CVITitles/CVITitle">
        <gxsl:value-of select="CVITitles/CVITitle[@id_cttype='listtitle']/Descr"/>
      </gxsl:if>
      </xsl:text>
      </p>

      <form action="?" method="post" name="updatelist">
        <input type="hidden" name="dp" value="updatelist{@id_cvinclude}"/>
        <input type="hidden" name="{@nickname}" value=""/>

        <gxsl:for-each select="Schedules/UpdateSchedule/SchedItem[@base='0']">
          <input type="hidden" name="{@nickname}" value=""/>
        </gxsl:for-each>

        <gxsl:for-each select="../CVIRBindings/CVIRBinding">
          <input type="hidden" name="{@p1}" value="{{/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}}}"/>
        </gxsl:for-each>

        <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
          <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
            <input type="hidden" name="{@p1}" value="{{/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}}}"/>
          </gxsl:if>
        </gxsl:for-each>

        <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
          <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
          <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
            <input type="hidden" name="{@property}" value="{{/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}}}"/>
          </gxsl:if>
        </gxsl:for-each>
      </form>

      <script language="JavaScript" type="text/javascript">
        <xsl:comment>
          <![CDATA[
            function compute()
            {
              if (!check()) return;
              var t = "<]]><gxsl:value-of select="@conceptcoll"/><![CDATA[>";
              var forms = document.forms;
              for (i = 0; i < forms.length; i++)
              {
                var form = forms[i];
                var h;
                if (form.name=='edtitem' && form.changed.value=='yes')
                {
                  t = t + "<]]><gxsl:value-of select="@concept"/><![CDATA[";
          ]]><gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@basegroup='true' and ((@onlist='show' and @onedit='show') or @key='1') and @attr='1']"><![CDATA[
                  h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                  h = h.replace(/&/g,'&amp;');
                  h = h.replace(/</g,'&lt;');
                  t = t + " ]]><gxsl:value-of select="@nicknamelow"/><![CDATA[=\"" + h + "\"";
          ]]></gxsl:for-each>
            <gxsl:if test="CVIProperties/CVIProperty[@nicknamelow='upd_ts'] and CVIProperties/CVIProperty[@nicknamelow='upd_uid']"><![CDATA[
                  t = t + " upd_ts=\"current\"";
                  t = t + " upd_uid=\"uid\"";
          ]]></gxsl:if><![CDATA[
                  t = t + ">";
          ]]><gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@basegroup='true' and ((@onlist='show' and @onedit='show') or @key='1') and @attr='0']"><![CDATA[
                  h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                  h = h.replace(/&/g,'&amp;');
                  h = h.replace(/</g,'&lt;');
                  t = t + "<]]><gxsl:value-of select="@nickname"/><![CDATA[>" + h + "</]]><gxsl:value-of select="@nickname"/><![CDATA[>";
          ]]></gxsl:for-each><![CDATA[
                  t = t + "</]]><gxsl:value-of select="@concept"/><![CDATA[>";
                }
              }
              t = t + "</]]><gxsl:value-of select="@conceptcoll"/><![CDATA[>";
              forms.updatelist.]]><gxsl:value-of select="@nickname"/><![CDATA[.value = t;

          ]]><gxsl:for-each select="Schedules/UpdateSchedule/SchedItem[@base='0']">
              <gxsl:variable name="concept"><gxsl:value-of select="@concept"/></gxsl:variable><![CDATA[
              var t = "<]]><gxsl:value-of select="@concept"/>s<![CDATA[>";
              var forms = document.forms;
              for (i = 0; i < forms.length; i++)
              {
                var form = forms[i];
                var h;
                if (form.name=='edtitem' && form.changed.value=='yes')
                {
                  t = t + "<]]><gxsl:value-of select="@concept"/><![CDATA[";
          ]]><gxsl:for-each select="../../../CVIProperties/CVIProperty[@concept=$concept and (PropGroup/@basegroup='false' or @extconcept='yes') and ((@onlist='show' and @onedit='show') or @key='1') and @attr='1']"><![CDATA[
                  h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                  h = h.replace(/&/g,'&amp;');
                  h = h.replace(/</g,'&lt;');
                  t = t + " ]]><gxsl:value-of select="@simplenamelow"/><![CDATA[=\"" + h + "\"";
          ]]></gxsl:for-each><![CDATA[
<!-- -->
          ]]><gxsl:for-each select="../../..//CVInclude[@virtual='1' and @rootnickpath=current()/@rootnickpath]/CVIProperties/CVIProperty[@key='1']">
              <gxsl:if test="not($cvinclude/CVIProperties/CVIProperty[@id_cproperty=current()/@id_cproperty])"><![CDATA[
                  h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                  h = h.replace(/&/g,'&amp;');
                  h = h.replace(/</g,'&lt;');
                  t = t + " ]]><gxsl:value-of select="@simplenamelow"/><![CDATA[=\"" + h + "\"";
          ]]></gxsl:if>
            </gxsl:for-each>
<!-- -->
            <gxsl:if test="../../../CVIProperties/CVIProperty[@concept=$concept and (PropGroup/@basegroup='false' or @extconcept='yes') and @simplenamelow='upd_ts'] and ../../../CVIProperties/CVIProperty[@concept=$concept and (PropGroup/@basegroup='false' or @extconcept='yes') and @simplenamelow='upd_uid']"><![CDATA[
                  t = t + " upd_ts=\"current\"";
                  t = t + " upd_uid=\"uid\"";
          ]]></gxsl:if><![CDATA[
                  t = t + ">";
          ]]><gxsl:for-each select="../../../CVIProperties/CVIProperty[@concept=$concept and (PropGroup/@basegroup='false' or @extconcept='yes') and ((@onlist='show' and @onedit='show') or @key='1') and @attr='0']"><![CDATA[
                  h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                  h = h.replace(/&/g,'&amp;');
                  h = h.replace(/</g,'&lt;');
                  t = t + "<]]><gxsl:value-of select="@simplename"/><![CDATA[>" + h + "</]]><gxsl:value-of select="@simplename"/><![CDATA[>";
          ]]></gxsl:for-each><![CDATA[
                  t = t + "</]]><gxsl:value-of select="@concept"/><![CDATA[>";
                }
              }
              t = t + "</]]><gxsl:value-of select="@concept"/>s<![CDATA[>";
              forms.updatelist.]]><gxsl:value-of select="@nickname"/><![CDATA[.value = t;
          ]]> </gxsl:for-each> <![CDATA[

              forms.updatelist.submit();
            }

            function itemchanged(form)
            {
              form.changed.value = "yes";
              document.forms.action.apply.disabled = true;
          ]]>
              <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@update='1' and @onlist='show' and @onedit='show' and @mandat='1']">
                if (form.<gxsl:value-of select="@formcode"/> &amp;&amp; (form.<gxsl:value-of select="@formcode"/>.value=='' || form.<gxsl:value-of select="@formcode"/>.value==' ')) return;
              </gxsl:for-each>
              <gxsl:if test="@update='1'">
                document.forms.action.apply.disabled=false;
              </gxsl:if>
          <![CDATA[
            }

            function check() {
              var forms = document.forms;
              for (k = 0; k < forms.length; k++) {
                var form = forms[k];
                if (form.name=='edtitem' && form.changed.value=='yes') {
          ]]>
            <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@basegroup='true' and @onlist='show' and @onedit='show']">
              <gxsl:choose>
                <gxsl:when test="@type='int'">
                  if (!valInt(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                </gxsl:when>
                <gxsl:when test="@type='float'">
                  if (!valFloat(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                </gxsl:when>
                <gxsl:when test="@type='date'">
                  if (!valDate(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>","ISO")) return false;
                </gxsl:when>
                <gxsl:when test="@type='datetime'">
                  if (!valDate(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                </gxsl:when>
                <gxsl:when test="@type='timestamp'">
                  if (!valDate(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                </gxsl:when>
              </gxsl:choose>
            </gxsl:for-each>
          <![CDATA[
                }
              }
              return true;
            }
          ]]>

        //</xsl:comment>
      </script>

      <xsl:variable name="propcols"><gxsl:value-of select="count(CVIProperties/CVIProperty[@onlist='show'])"/></xsl:variable>
      <xsl:variable name="othercols">
        <gxsl:variable name="select">
          <gxsl:if test="@update='1' or @detail='1'">1+</gxsl:if>
          <gxsl:if test="@delete='1'">count(/DPOutput[@access!='r'])+</gxsl:if>
          <gxsl:text>count(/DPOutput/DPList[@selectfun and @selectfun!='no'])+</gxsl:text>
          <gxsl:choose>
            <gxsl:when test="@delete='1' and @deletecoll='1'">count(/DPOutput[@access!='r' or DPList[@selectfun and @selectfun!='no' and @allowmulti='1']])</gxsl:when>
            <gxsl:otherwise>count(/DPOutput/DPList[@selectfun and @selectfun!='no' and @allowmulti='1'])</gxsl:otherwise>
          </gxsl:choose>
        </gxsl:variable>
        <xsl:value-of select="{$select}"/>
      </xsl:variable>

        <table>
          <form action="?" method="post" name="action">
          <input type="hidden" name="keys"/>

          <input type="hidden" name="dp" value="deletecoll{@id_cvinclude}"/>
          <input type="hidden" name="{@conceptcoll}" value=""/>
          <gxsl:for-each select="Schedules/DeleteVirtualSchedule/SchedItem[@reltype='1:1']">
            <input type="hidden" name="{@path}s" value=""/>
          </gxsl:for-each>

          <xsl:apply-templates select="DPFilter">
            <xsl:with-param name="propcols" select="$propcols"/>
            <xsl:with-param name="othercols" select="$othercols"/>
          </xsl:apply-templates>

          <tr>

            <xsl:choose>
              <xsl:when test="@orderkey='no'">
                <th>#&#160;</th>
              </xsl:when>
              <xsl:otherwise>
                <th><a>
                  <xsl:attribute name="href">
                    <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/>
                    <xsl:text>&amp;<gxsl:value-of select="@concept"/>.orderby=</xsl:text>
                    <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                      <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                        <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                      </gxsl:if>
                    </gxsl:for-each>
                    <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                      <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                      <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                        <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                      </gxsl:if>
                    </gxsl:for-each>
                  </xsl:attribute>#</a>&#160;</th>
              </xsl:otherwise>
            </xsl:choose>

            <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@select='1' and @onlist='show']">
              <gxsl:choose>
                <gxsl:when test="not(RefProp)">
                  <xsl:choose>
                    <xsl:when test="@orderby='{@name}'">
                      <th class="ordered"><a>
                        <xsl:attribute name="href">
                          <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                          <xsl:text><gxsl:value-of select="../../@concept"/>.orderby=<gxsl:value-of select="@name"/>&amp;</xsl:text>
                          <xsl:text><gxsl:value-of select="../../@concept"/>.order=</xsl:text><xsl:choose><xsl:when test="@order='desc'">asc</xsl:when><xsl:otherwise>desc</xsl:otherwise></xsl:choose>
                          <gxsl:for-each select="../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                            <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                              <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                          <gxsl:for-each select="../../ancestor::CVInclude/Keys/Binding">
                            <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                            <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                              <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                        </xsl:attribute>
                        <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
                        <gxsl:value-of select="Title"/></a><xsl:if test="@order='desc'">*</xsl:if></th>
                    </xsl:when>
                    <xsl:otherwise>
                      <th><a>
                        <xsl:attribute name="href">
                          <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                          <xsl:text><gxsl:value-of select="../../@concept"/>.orderby=<gxsl:value-of select="@name"/></xsl:text>
                          <gxsl:for-each select="../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                            <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                              <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                          <gxsl:for-each select="../../ancestor::CVInclude/Keys/Binding">
                            <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                            <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                              <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                        </xsl:attribute>
                        <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
                        <gxsl:value-of select="Title"/></a></th>
                    </xsl:otherwise>
                  </xsl:choose>
                </gxsl:when>

                <gxsl:when test="@fetchtype='direct' and @onedit='show'">
                  <gxsl:variable name="rptitle">
                    <gxsl:choose>
                      <gxsl:when test="count(RefProp)>1"><gxsl:value-of select="Title"/>: <gxsl:for-each select="RefProp"><gxsl:value-of select="Title"/><gxsl:if test="position()!=last()">,&#160;</gxsl:if></gxsl:for-each></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="Title"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <gxsl:variable name="rpdescr">
                    <gxsl:value-of select="Descr"/>
                  </gxsl:variable>

                  <gxsl:for-each select="RefProp[1]">
                    <xsl:choose>
                      <xsl:when test="@orderby='{../@nickname}.{@refconcept}/{@code}'">
                        <th class="ordered"><a>
                          <xsl:attribute name="href">
                            <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                            <xsl:text><gxsl:value-of select="../../../@concept"/>.orderby=<gxsl:value-of select="../@nickname"/>.<gxsl:value-of select="@refconcept"/>/<gxsl:value-of select="@code"/>&amp;</xsl:text>
                            <xsl:text><gxsl:value-of select="../../../@concept"/>.order=</xsl:text><xsl:choose><xsl:when test="@order='desc'">asc</xsl:when><xsl:otherwise>desc</xsl:otherwise></xsl:choose>
                            <gxsl:for-each select="../../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                                <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                            <gxsl:for-each select="../../../ancestor::CVInclude/Keys/Binding">
                              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                          </xsl:attribute>
                          <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="$rptitle"/><gxsl:with-param name="desc" select="$rpdescr"/></gxsl:call-template>
                          <gxsl:value-of select="$rptitle"/></a><xsl:if test="@order='desc'">*</xsl:if></th>
                      </xsl:when>
                      <xsl:otherwise>
                        <th><a>
                          <xsl:attribute name="href">
                            <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                            <xsl:text><gxsl:value-of select="../../../@concept"/>.orderby=<gxsl:value-of select="../@nickname"/>.<gxsl:value-of select="@refconcept"/>/<gxsl:value-of select="@code"/></xsl:text>
                            <gxsl:for-each select="../../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                                <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                            <gxsl:for-each select="../../../ancestor::CVInclude/Keys/Binding">
                              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                          </xsl:attribute>
                          <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="$rptitle"/><gxsl:with-param name="desc" select="$rpdescr"/></gxsl:call-template>
                          <gxsl:value-of select="$rptitle"/></a></th>
                      </xsl:otherwise>
                    </xsl:choose>
                  </gxsl:for-each>
                </gxsl:when>

                <gxsl:otherwise>
                  <gxsl:if test="@fetchtype='external' and @extwork and @extwork!='' and @onedit='show' and @key!='1'">
                  <xsl:choose>
                    <xsl:when test="@orderby='{@name}'">
                      <th class="ordered"><a>
                        <xsl:attribute name="href">
                          <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                          <xsl:text><gxsl:value-of select="../../@concept"/>.orderby=<gxsl:value-of select="@name"/>&amp;</xsl:text>
                          <xsl:text><gxsl:value-of select="../../@concept"/>.order=</xsl:text><xsl:choose><xsl:when test="@order='desc'">asc</xsl:when><xsl:otherwise>desc</xsl:otherwise></xsl:choose>
                          <gxsl:for-each select="../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                            <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                              <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                          <gxsl:for-each select="../../ancestor::CVInclude/Keys/Binding">
                            <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                            <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                              <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                        </xsl:attribute>
                        <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
                        <gxsl:value-of select="Title"/></a><xsl:if test="@order='desc'">*</xsl:if></th>
                    </xsl:when>
                    <xsl:otherwise>
                      <th><a>
                        <xsl:attribute name="href">
                          <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                          <xsl:text><gxsl:value-of select="../../@concept"/>.orderby=<gxsl:value-of select="@name"/></xsl:text>
                          <gxsl:for-each select="../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                            <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                              <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                          <gxsl:for-each select="../../ancestor::CVInclude/Keys/Binding">
                            <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                            <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                              <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                            </gxsl:if>
                          </gxsl:for-each>
                        </xsl:attribute>
                        <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="Title"/><gxsl:with-param name="desc" select="Descr"/></gxsl:call-template>
                        <gxsl:value-of select="Title"/></a></th>
                    </xsl:otherwise>
                  </xsl:choose>

                  </gxsl:if>
                  <gxsl:for-each select="RefProp">
                    <gxsl:variable name="rptitle">
                      <gxsl:choose>
                        <gxsl:when test="last()>1"><gxsl:value-of select="../Title"/>: <gxsl:value-of select="Title"/></gxsl:when>
                        <gxsl:otherwise><gxsl:value-of select="../Title"/></gxsl:otherwise>
                      </gxsl:choose>
                    </gxsl:variable>
                    <gxsl:variable name="rpdescr">
                      <gxsl:choose>
                        <gxsl:when test="last()>1"><gxsl:value-of select="Descr"/></gxsl:when>
                        <gxsl:otherwise><gxsl:value-of select="../Descr"/></gxsl:otherwise>
                      </gxsl:choose>
                    </gxsl:variable>

                    <xsl:choose>
                      <xsl:when test="@orderby='{../@nickname}.{@refconcept}/{@code}'">
                        <th class="ordered"><a>
                          <xsl:attribute name="href">
                            <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                            <xsl:text><gxsl:value-of select="../../../@concept"/>.orderby=<gxsl:value-of select="../@nickname"/>.<gxsl:value-of select="@refconcept"/>/<gxsl:value-of select="@code"/>&amp;</xsl:text>
                            <xsl:text><gxsl:value-of select="../../../@concept"/>.order=</xsl:text><xsl:choose><xsl:when test="@order='desc'">asc</xsl:when><xsl:otherwise>desc</xsl:otherwise></xsl:choose>
                            <gxsl:for-each select="../../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                                <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                            <gxsl:for-each select="../../../ancestor::CVInclude/Keys/Binding">
                              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                          </xsl:attribute>
                          <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="$rptitle"/><gxsl:with-param name="desc" select="$rpdescr"/></gxsl:call-template>
                          <gxsl:value-of select="$rptitle"/></a><xsl:if test="@order='desc'">*</xsl:if></th>
                      </xsl:when>
                      <xsl:otherwise>
                        <th><a>
                          <xsl:attribute name="href">
                            <xsl:text>?dp=</xsl:text><xsl:value-of select="/DPOutput/@dataport"/><xsl:text>&amp;</xsl:text>
                            <xsl:text><gxsl:value-of select="../../../@concept"/>.orderby=<gxsl:value-of select="../@nickname"/>.<gxsl:value-of select="@refconcept"/>/<gxsl:value-of select="@code"/></xsl:text>
                            <gxsl:for-each select="../../../ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                                <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                            <gxsl:for-each select="../../../ancestor::CVInclude/Keys/Binding">
                              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                              </gxsl:if>
                            </gxsl:for-each>
                          </xsl:attribute>
                          <gxsl:call-template name="tooltip"><gxsl:with-param name="title" select="$rptitle"/><gxsl:with-param name="desc" select="$rpdescr"/></gxsl:call-template>
                          <gxsl:value-of select="$rptitle"/></a></th>
                      </xsl:otherwise>
                    </xsl:choose>
                  </gxsl:for-each>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:for-each>

            <xsl:if test="/DPOutput/DPList/@filterfirst!='1'">
            <gxsl:if test="@update='1' or @detail='1'">
              <th>&#160;</th>
            </gxsl:if>
            <gxsl:if test="@delete='1'">
              <xsl:if test="/DPOutput/@access!='r'">
                <gxsl:if test="@deletecoll='1'">
                  <gxsl:for-each select="../CVIRBindings/CVIRBinding">
                    <input type="hidden" name="{@p1}" value="{{../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}}}"/>
                  </gxsl:for-each>
  
                  <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                    <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                      <input type="hidden" name="{@p1}" value="{{../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}}}"/>
                    </gxsl:if>
                  </gxsl:for-each>
  
                  <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                    <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                    <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                      <input type="hidden" name="{@property}" value="{{../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}}}"/>
                    </gxsl:if>
                  </gxsl:for-each>
                </gxsl:if>
                <gxsl:choose>
                  <gxsl:when test="@required='-'">
                    <xsl:if test="/DPOutput/DPList/DPPage/@total!=1">
                      <gxsl:choose>
                        <gxsl:when test="@deletecoll='1'">
                          <th><input type="button" name="deleteapply" disabled="true" value="{$dict/Text[@tid='rmv']/Value[@lang=$lang]}" class="input_filter" onclick="deleteApply();"/></th>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <th>&#160;</th>
                        </gxsl:otherwise>
                      </gxsl:choose>
                    </xsl:if>
                  </gxsl:when>
                  <gxsl:otherwise>
                    <gxsl:choose>
                      <gxsl:when test="@deletecoll='1'">
                        <th><input type="button" name="deleteapply" disabled="true" value="{$dict/Text[@tid='rmv']/Value[@lang=$lang]}" class="input_filter" onclick="deleteApply();"/></th>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <th>&#160;</th>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:otherwise>
                </gxsl:choose>
              </xsl:if>
            </gxsl:if>
            <xsl:if test="@selectfun and @selectfun!='' and @selectfun!='no'">
              <xsl:choose>
                <xsl:when test="@allowmulti='1'">
                  <th><input type="button" name="selectapply" disabled="true" value="{$dict/Text[@tid='select']/Value[@lang=$lang]}" class="input_filter" onclick="selectApply();"/></th>
                </xsl:when>
                <xsl:otherwise>
                  <th>&#160;</th>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:if>

            <gxsl:choose>
              <gxsl:when test="@delete='1' and @deletecoll='1'">
                <xsl:choose>
                  <xsl:when test="/DPOutput/@access!='r'">
                    <gxsl:choose>
                      <gxsl:when test="@required='-'">
                        <xsl:if test="/DPOutput/DPList/DPPage/@total!=1 or (@selectfun and @selectfun!='' and @selectfun!='no' and @allowmulti='1')">
                          <th><gxsl:value-of select="$dict/Text[@tid='checkall']/Value[@lang=$lang]"/> <input type="checkbox" name="all" onClick="selectAll();"/></th>
                        </xsl:if>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <th><gxsl:value-of select="$dict/Text[@tid='checkall']/Value[@lang=$lang]"/> <input type="checkbox" name="all" onClick="selectAll();"/></th>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:if test="@selectfun and @selectfun!='' and @selectfun!='no' and @allowmulti='1'">
                      <th><gxsl:value-of select="$dict/Text[@tid='checkall']/Value[@lang=$lang]"/> <input type="checkbox" name="all" onClick="selectAll();"/></th>
                    </xsl:if>
                  </xsl:otherwise>
                </xsl:choose>
              </gxsl:when>
              <gxsl:otherwise>
                <xsl:if test="@selectfun and @selectfun!='' and @selectfun!='no' and @allowmulti='1'">
                  <th><gxsl:value-of select="$dict/Text[@tid='checkall']/Value[@lang=$lang]"/> <input type="checkbox" name="all" onClick="selectAll();"/></th>
                </xsl:if>
              </gxsl:otherwise>
            </gxsl:choose>
            </xsl:if>

            </tr>
          </form>

          <xsl:if test="@filterfirst=1">
            <tr>
              <td align="center" colspan="{{1+{count(CVIProperties/CVIProperty[@onlist='show'])}}}">
                <br/><b><gxsl:value-of select="$dict/Text[@tid='filter_first']/Value[@lang=$lang]"/></b><br/>
              </td>
            </tr>
          </xsl:if>

          <script language="JavaScript" type="text/javascript">
            <xsl:comment>
              <![CDATA[
                function computeSelection() {
                  var allselectedflag = true;
                  var h = document.forms["action"].keys;
                  h.value = "";
                  for (i = 0; i < document.forms.length; i++) {
                    var form = document.forms[i];
                    if (form.name=='edtitem') {
                      if (form.selected.checked) {
                        if (h.value == "") {
                          h.value = form.key.value;
                        } else {
                          h.value = h.value+","+form.key.value;
                        }
                      } else allselectedflag = false;
                    }
                  }

                  if (document.forms["action"].keys.value != "") {
                    var e = document.forms["action"].elements;
                    for (i = 0; i < e.length; i++) {
                      if (e[i].name=="selectapply" || e[i].name=="deleteapply") e[i].disabled = false;
                    }
                  } else {
                    var e = document.forms["action"].elements;
                    for (i = 0; i < e.length; i++) {
                      if (e[i].name=="selectapply" || e[i].name=="deleteapply") e[i].disabled = true;
                    }
                  }

                  document.forms["action"].all.checked = allselectedflag;
                }

                function selectApply() {
                  multiselect(document.forms["action"].keys.value);
                }

                function deleteApply() {
                  if (!confirm("]]><gxsl:value-of select="$dict/Text[@tid='cfmdelcoll']/Value[@lang=$lang]"/><![CDATA[")) return;
                  var t = "<]]><gxsl:value-of select="@conceptcoll"/><![CDATA[>";
                  var forms = document.forms;
                  for (i = 0; i < forms.length; i++) {
                    var form = forms[i];
                    var h;
                    if (form.name=='edtitem' && form.selected.checked) {
                      t = t+ "<]]><gxsl:value-of select="@concept"/><![CDATA[";
              ]]><gxsl:for-each select="CVIProperties/CVIProperty[@key='1' and @attr='1']"><![CDATA[
                      h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                      h = h.replace(/&/g,'&amp;');
                      h = h.replace(/</g,'&lt;');
                      t = t + " ]]><gxsl:value-of select="@nicknamelow"/><![CDATA[=\"" + h + "\"";
              ]]></gxsl:for-each><![CDATA[
                      t = t + ">";
              ]]><gxsl:for-each select="CVIProperties/CVIProperty[@key='1' and @attr='0']"><![CDATA[
                      h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                      h = h.replace(/&/g,'&amp;');
                      h = h.replace(/</g,'&lt;');
                      t = t + "<]]><gxsl:value-of select="@nickname"/><![CDATA[>" + h + "</]]><gxsl:value-of select="@nickname"/><![CDATA[>";
              ]]></gxsl:for-each><![CDATA[
                      t = t + "</]]><gxsl:value-of select="@concept"/><![CDATA[>";
                    }
                  }
                  t = t + "</]]><gxsl:value-of select="@conceptcoll"/><![CDATA[>";
                  forms.action.]]><gxsl:value-of select="@conceptcoll"/><![CDATA[.value = t;


              ]]><gxsl:for-each select="Schedules/DeleteVirtualSchedule/SchedItem[@reltype='1:1']"><![CDATA[
                  var t = "<]]><gxsl:value-of select="@concept"/>s<![CDATA[>";
                  var forms = document.forms;
                  for (i = 0; i < forms.length; i++) {
                    var form = forms[i];
                    var h;
                    if (form.name=='edtitem' && form.selected.checked) {
                      t = t+ "<]]><gxsl:value-of select="@concept"/><![CDATA[";
              ]]><gxsl:for-each select="../../../CVIProperties/CVIProperty[PropGroup/@virtual='1' and @key='1' and @attr='1']"><![CDATA[
                      h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                      h = h.replace(/&/g,'&amp;');
                      h = h.replace(/</g,'&lt;');
                      t = t + " ]]><gxsl:value-of select="@simplenamelow"/><![CDATA[=\"" + h + "\"";
              ]]></gxsl:for-each><![CDATA[
                      t = t + ">";
              ]]><gxsl:for-each select="../../../CVIProperties/CVIProperty[PropGroup/@virtual='1' and @key='1' and @attr='0']"><![CDATA[
                      h = form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value;
                      h = h.replace(/&/g,'&amp;');
                      h = h.replace(/</g,'&lt;');
                      t = t + "<]]><gxsl:value-of select="@simplename"/><![CDATA[>" + h + "</]]><gxsl:value-of select="@nickname"/><![CDATA[>";
              ]]></gxsl:for-each><![CDATA[
                      t = t + "</]]><gxsl:value-of select="@concept"/><![CDATA[>";
                    }
                  }
                  t = t + "</]]><gxsl:value-of select="@concept"/>s<![CDATA[>";
                  forms.action.]]><gxsl:value-of select="@path"/>s<![CDATA[.value = t;

              ]]></gxsl:for-each><![CDATA[

                  document.forms["action"].submit();
                }

                function selectAll() {
                  for (i = 0; i < document.forms.length; i++) {
                    var form = document.forms[i];
                    if (form.name=='edtitem') form.selected.checked = document.forms["action"].all.checked;
                  }

                  computeSelection();
                }
              ]]>
            //</xsl:comment>
          </script>

          <gxsl:choose>
            <gxsl:when test="@treelist='1' and name(..)='CView'">
              <gxsl:choose>
                <gxsl:when test="../CVIRBindings/CVIRBinding">
                  <xsl:choose>
                    <xsl:when test="Classes/Class">
                      <xsl:apply-templates select="{ancestor::CView/@name}/{@conceptcoll}/{@concept}[@{../CVIRBindings/CVIRBinding/@p2low}=/DPOutput/DPNavig/{ancestor::CView/CVInclude/@conceptcoll}/{ancestor::CView/CVInclude/@concept}/@{../CVIRBindings/CVIRBinding/@p1low}]">
                        <xsl:with-param name="root" select="."/>
                      </xsl:apply-templates>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:apply-templates select="{ancestor::CView/@name}/{@conceptcoll}/{@concept}">
                        <xsl:with-param name="root" select="."/>
                      </xsl:apply-templates>
                    </xsl:otherwise>
                  </xsl:choose>
                </gxsl:when>
                <gxsl:otherwise>
                  <xsl:apply-templates select="{ancestor::CView/@name}/{@conceptcoll}/{@concept}">
                    <xsl:with-param name="root" select="."/>
                  </xsl:apply-templates>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:when>
            <gxsl:otherwise>
              <gxsl:choose>
                <gxsl:when test="../CVIRBindings/CVIRBinding">
                  <xsl:choose>
                    <xsl:when test="Classes/Class">
                      <xsl:apply-templates select="{@conceptcoll}/{@concept}[@{../CVIRBindings/CVIRBinding/@p2low}=/DPOutput/DPNavig/{ancestor::CView/CVInclude/@conceptcoll}/{ancestor::CView/CVInclude/@concept}/@{../CVIRBindings/CVIRBinding/@p1low}]">
                        <xsl:with-param name="root" select="."/>
                      </xsl:apply-templates>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:apply-templates select="{@conceptcoll}/{@concept}">
                        <xsl:with-param name="root" select="."/>
                      </xsl:apply-templates>
                    </xsl:otherwise>
                  </xsl:choose>
                </gxsl:when>
                <gxsl:otherwise>
                  <xsl:apply-templates select="{@conceptcoll}/{@concept}">
                    <xsl:with-param name="root" select="."/>
                  </xsl:apply-templates>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:otherwise>
          </gxsl:choose>

          <xsl:if test="@filterfirst=1">
            <tr>
              <td align="center" colspan="{{1+{count(CVIProperties/CVIProperty[@onlist='show'])}}}">
                <br/><b><gxsl:value-of select="$dict/Text[@tid='filter_first']/Value[@lang=$lang]"/></b><br/>
              </td>
            </tr>
          </xsl:if>

          <xsl:choose>
            <xsl:when test="Classes/Class">
              <xsl:for-each select="Classes/Class">
                <tr><td class="text"><xsl:attribute name="colspan"><xsl:choose><xsl:when test="/DPOutput/DPList/@filterfirst='1'"><xsl:value-of select="1+11"/></xsl:when><xsl:otherwise><xsl:value-of select="1+11+$othercols"/></xsl:otherwise></xsl:choose></xsl:attribute></td></tr>
                <tr><td class="text"><xsl:attribute name="colspan"><xsl:choose><xsl:when test="/DPOutput/DPList/@filterfirst='1'"><xsl:value-of select="1+11"/></xsl:when><xsl:otherwise><xsl:value-of select="1+11+$othercols"/></xsl:otherwise></xsl:choose></xsl:attribute></td></tr>
                <tr><td class="text"><xsl:attribute name="colspan"><xsl:choose><xsl:when test="/DPOutput/DPList/@filterfirst='1'"><xsl:value-of select="1+11"/></xsl:when><xsl:otherwise><xsl:value-of select="1+11+$othercols"/></xsl:otherwise></xsl:choose></xsl:attribute></td></tr>
                <tr><td class="text"><xsl:attribute name="colspan"><xsl:choose><xsl:when test="/DPOutput/DPList/@filterfirst='1'"><xsl:value-of select="1+11"/></xsl:when><xsl:otherwise><xsl:value-of select="1+11+$othercols"/></xsl:otherwise></xsl:choose></xsl:attribute></td></tr>
                <tr><td class="text"><xsl:attribute name="colspan"><xsl:choose><xsl:when test="/DPOutput/DPList/@filterfirst='1'"><xsl:value-of select="1+11"/></xsl:when><xsl:otherwise><xsl:value-of select="1+11+$othercols"/></xsl:otherwise></xsl:choose></xsl:attribute></td></tr>

                <tr>
                  <td class="text">
                    <xsl:attribute name="colspan">
                      <xsl:choose>
                        <xsl:when test="/DPOutput/DPList/@filterfirst='1'">
                          <xsl:value-of select="1+11"/>
                        </xsl:when>
                        <xsl:otherwise>
                          <xsl:value-of select="1+11+$othercols"/>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:attribute>
                    <a class="text" href="../{{/DPOutput/@package}}/?dp=edit&amp;{ancestor::CView/CVInclude/Keys/Binding/@property}={{@value}}" target="_blank" style="cursor:pointer"><strong><xsl:value-of select="@caption"/></strong></a>
                  </td>
                </tr>

                <gxsl:if test="../CVIRBindings/CVIRBinding/@p2low">
                  <xsl:variable name="value"><xsl:value-of select="@value"/></xsl:variable>
                  <xsl:apply-templates select="../../{@conceptcoll}/{@concept}[@{../CVIRBindings/CVIRBinding/@p2low}=$value]">
                    <xsl:with-param select="/DPOutput/DPList" name="root"/>
                  </xsl:apply-templates>
                </gxsl:if>
              </xsl:for-each>
              <tr>
                <td class="text">
                  <xsl:attribute name="colspan">
                    <xsl:choose>
                      <xsl:when test="/DPOutput/DPList/@filterfirst='1'">
                        <xsl:value-of select="1+{count(CVIProperties/CVIProperty[@onlist='show'])}"/>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="1+{count(CVIProperties/CVIProperty[@onlist='show'])}+$othercols"/>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:attribute>
                  <!-- classed listings are not going to be paged yet -->
                  <!-- <xsl:apply-templates select="DPPage"/> -->
                </td>
              </tr>
            </xsl:when>
            <xsl:otherwise>
              <tr>
                <td class="text">
                  <xsl:attribute name="colspan">
                    <xsl:choose>
                      <xsl:when test="/DPOutput/DPList/@filterfirst='1'">
                        <xsl:value-of select="1+{count(CVIProperties/CVIProperty[@onlist='show'])}"/>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="1+{count(CVIProperties/CVIProperty[@onlist='show'])}+$othercols"/>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:attribute>
                  <xsl:apply-templates select="DPPage"/>
                </td>
              </tr>
            </xsl:otherwise>
          </xsl:choose>

          <tr>
            <td>
              <xsl:attribute name="colspan">
                <xsl:choose>
                  <xsl:when test="/DPOutput/DPList/@filterfirst='1'">
                    <xsl:value-of select="1+{count(CVIProperties/CVIProperty[@onlist='show'])}"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="1+{count(CVIProperties/CVIProperty[@onlist='show'])}+$othercols"/>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:attribute>

              <table border="0" cellspacing="0" cellpadding="0" width="100%" class="text">
                <tr>
                  <td align="left">
                    <gxsl:if test="@create='1'">
                      <xsl:if test="/DPOutput/@access!='r'">
                        <xsl:call-template name="createButton">
                          <xsl:with-param name="dpList" select="."/>
                          <xsl:with-param name="plusSign">0</xsl:with-param>
                        </xsl:call-template>
                      </xsl:if>
                    </gxsl:if>
                    &#160;
                  </td>
                  <td align="right">
                    &#160;
                    <nobr>
                      <gxsl:if test="count(CVIStyles/CVIStyle[Style/StyleType/@name='list'])&gt;1">
                        <gxsl:for-each select="CVIStyles/CVIStyle[Style/StyleType/@name='list']">
                          <xsl:choose>
                            <xsl:when test="@style={position()}">
                              <gxsl:attribute name="test">@style=<gxsl:value-of select="position()"/></gxsl:attribute>
                              <gxsl:value-of select="Style/StyleTitles/StyleTitle[@id_lang=$lang]/Title"/>
                              <gxsl:if test="position()!=last()">&#160;|&#160;</gxsl:if>
                            </xsl:when>
                            <xsl:otherwise>
                              <a>
                                <xsl:attribute name="href">
                                <gxsl:choose>
                                  <gxsl:when test="name(..)!='CView'">
                                    <xsl:text>?dp=list</xsl:text><gxsl:value-of select="../../@id_cvinclude"/>
                                    <gxsl:for-each select="../../../../../Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<gxsl:variable name="prop"><gxsl:choose><gxsl:when test="@inattr='1'">@<gxsl:value-of select="@propertylow"/></gxsl:when><gxsl:otherwise><gxsl:value-of select="@property"/></gxsl:otherwise></gxsl:choose></gxsl:variable><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/{$prop}"/></gxsl:for-each>
                                    <gxsl:for-each select="../../ancestor::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p2"/>=<xsl:value-of select="../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
                                    <gxsl:for-each select="../../ancestor::CVInclude/Keys/Binding">
                                      <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                                      <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                                        <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                                      </gxsl:if>
                                    </gxsl:for-each>&amp;style=<gxsl:value-of select="position()"/>
                                  </gxsl:when>
                                  <gxsl:otherwise>
                                    <xsl:text>?dp=list<gxsl:value-of select="../../@id_cvinclude"/>&amp;style=<gxsl:value-of select="position()"/></xsl:text>
                                  </gxsl:otherwise>
                                </gxsl:choose>
                                </xsl:attribute>
                                <gxsl:value-of select="Style/StyleTitles/StyleTitle[@id_lang=$lang]/Title"/>
                              </a>
                              <gxsl:if test="position()!=last()">&#160;|&#160;</gxsl:if>
                            </xsl:otherwise>
                          </xsl:choose>
                        </gxsl:for-each>
                      </gxsl:if>
                    </nobr>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </xsl:template>


      <xsl:template match="{@concept}">
        <xsl:param name="root"/>

        <form action="" name="edtitem" onsubmit="return false;">
        <input type="hidden" name="changed" value="no"/>
        <tr>
        <xsl:attribute name="class">
          <xsl:choose>
            <xsl:when test="position() mod 2 = 1">row1</xsl:when>
            <xsl:otherwise>row2</xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <td class="row">
          <gxsl:choose>
            <gxsl:when test="@update='1' or @detail='1'">
              <a title="{$dict/Text[@tid='edt']/Value[@lang=$lang]}/{$dict/Text[@tid='detail']/Value[@lang=$lang]}">
                <xsl:attribute name="href">?dp=edit<gxsl:value-of select="@id_cvinclude"/>
                  <gxsl:for-each select="Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<xsl:value-of select="@{@propertylow}"/></gxsl:for-each>
                  <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>=<xsl:value-of select="/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
                  <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                    <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                    <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                      <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                    </gxsl:if>
                  </gxsl:for-each>
                </xsl:attribute>
                <xsl:choose>
                  <xsl:when test="not($root/DPPage/@at)"><xsl:value-of select="position()"/>.</xsl:when>
                  <xsl:otherwise><xsl:value-of select="$root/DPPage/@at + position() - 1"/>.</xsl:otherwise>
                </xsl:choose>
              </a>
            </gxsl:when>
            <gxsl:otherwise>
              <xsl:choose>
                <xsl:when test="not($root/DPPage/@at)"><xsl:value-of select="position()"/>.</xsl:when>
                <xsl:otherwise><xsl:value-of select="$root/DPPage/@at + position() - 1"/>.</xsl:otherwise>
              </xsl:choose>            
            </gxsl:otherwise>
          </gxsl:choose>
          <xsl:text>&#160;</xsl:text>

          <gxsl:if test="@delete='1'">
            <xsl:if>
              <gxsl:attribute name="test">
                <gxsl:text>/DPOutput/@access!='r' and </gxsl:text>
                <gxsl:text>/DPOutput/BS_Person/prefdel='1'</gxsl:text>
                <gxsl:if test="@required='-'">and /DPOutput/DPList/DPPage/@total!=1</gxsl:if>
              </gxsl:attribute>
              <a title="{$dict/Text[@tid='rmv']/Value[@lang=$lang]}">
                <xsl:attribute name="href">?dp=remove<gxsl:value-of select="@id_cvinclude"/>
                  <gxsl:for-each select="Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<xsl:value-of select="@{@propertylow}"/></gxsl:for-each>
                  <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>=<xsl:value-of select="/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
                  <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                    <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                    <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                      <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                    </gxsl:if>
                  </gxsl:for-each>
                </xsl:attribute>
                <b>x</b>
              </a>
            </xsl:if>
          </gxsl:if>
        </td>

        <xsl:variable name="worktype"><xsl:value-of select="substring-after(substring-before(/DPOutput/@package,'@'),'.')"/><xsl:if test="contains(/DPOutput/@package,'@')">@</xsl:if></xsl:variable>

        <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@select='1' and @onlist='show' or @key='1']">
          <gxsl:variable name="enum">
            <gxsl:choose>
              <gxsl:when test="@enum='true'">true</gxsl:when>
              <gxsl:otherwise>false</gxsl:otherwise>
            </gxsl:choose>
          </gxsl:variable>

          <gxsl:choose>
            <gxsl:when test="@key='1' and @onlist='show'"> <!-- we do not edit keys, just show them as usual -->
              <gxsl:choose>
                <gxsl:when test="@attr='1'">
                  <input type="hidden" name="{@formcode}" value="{{@{@nicknamelow}}}"/>
                </gxsl:when>
                <gxsl:otherwise>
                  <input type="hidden" name="{@formcode}" value="{{{@nickname}}}"/>
                </gxsl:otherwise>
              </gxsl:choose>
              <gxsl:choose>
                <gxsl:when test="@fetchtype='external' and @ref and @ref!='' and @extwork and @extwork!=''">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <xsl:variable name="sub"><xsl:if test="substring-before(substring-after(/DPOutput/@package,'.'),'.')='ro'">ro.</xsl:if></xsl:variable>
                  <gxsl:choose>
                    <gxsl:when test="not(RefProp)">
                      <td class="row">
                        <a class="text" href="../{{substring-before(/DPOutput/@package,'.')}}.{{$sub}}{@extwork}/?dp=edit&amp;{@refprop}={{{$valsrcprm}}}" target="_blank" style="cursor:pointer">
                          <xsl:value-of select="{$valsrcprm}"/>
                        </a>
                      </td>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <gxsl:for-each select="RefProp">
                        <gxsl:variable name="valsrcrefprm">
                          <gxsl:choose>
                            <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                            <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                          </gxsl:choose>
                        </gxsl:variable>
                        <td class="row">
                          <a class="text" href="../{{substring-before(/DPOutput/@package,'.')}}.{{$sub}}{../@extwork}/?dp=edit&amp;{../@refprop}={{{$valsrcprm}}}" target="_blank" style="cursor:pointer">
                            <xsl:value-of select="{$valsrcrefprm}"/>
                          </a>
                        </td>
                      </gxsl:for-each>
                    </gxsl:otherwise>
                  </gxsl:choose>
                </gxsl:when>
                <gxsl:when test="CPStaticValues/CPStaticValue">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <td class="row">
                    <xsl:choose>
                      <gxsl:for-each select="CPStaticValues/CPStaticValue">
                        <xsl:when test="{$valsrcprm}='{statval}'"><gxsl:value-of select="title"/></xsl:when>                    
                      </gxsl:for-each>
                      <xsl:otherwise><xsl:value-of select="{$valsrcprm}"/></xsl:otherwise>
                    </xsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:when test="not(RefProp)">
                  <td class="row">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">
                        <xsl:value-of select="@{@nicknamelow}"/>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <xsl:value-of select="{@nickname}"/>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:for-each select="RefProp">
                    <td class="row">
                      <gxsl:choose>
                        <gxsl:when test="@attr='1'">
                          <xsl:value-of select="@{@nicknamelow}"/>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <xsl:value-of select="{@nickname}"/>
                        </gxsl:otherwise>
                      </gxsl:choose>
                    </td>
                  </gxsl:for-each>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:when>

            <gxsl:when test="@key='1'">
              <gxsl:choose>
                <gxsl:when test="@attr='1'">
                  <input type="hidden" name="{@formcode}" value="{{@{@nicknamelow}}}"/>
                </gxsl:when>
                <gxsl:otherwise>
                  <input type="hidden" name="{@formcode}" value="{{{@nickname}}}"/>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:when>

            <gxsl:when test="@onedit!='show'">
              <gxsl:choose>
                <gxsl:when test="CPStaticValues/CPStaticValue">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <td class="row">
                    <xsl:choose>
                      <gxsl:for-each select="CPStaticValues/CPStaticValue">
                        <xsl:when test="{$valsrcprm}='{statval}'"><gxsl:value-of select="title"/></xsl:when>                    
                      </gxsl:for-each>
                      <xsl:otherwise><xsl:value-of select="{$valsrcprm}"/></xsl:otherwise>
                    </xsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:when test="@type='boolean'">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <td class="row">
                    <xsl:choose>
                      <xsl:when test="{$valsrcprm}='1'">
                        <xsl:text><gxsl:value-of select="translate($dict/Text[@tid='Yes']/Value[@lang=$lang],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/></xsl:text>
                      </xsl:when>
                      <xsl:when test="{$valsrcprm}='0'">
                        <xsl:text><gxsl:value-of select="translate($dict/Text[@tid='No']/Value[@lang=$lang],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/></xsl:text>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:text>&#160;</xsl:text>
                      </xsl:otherwise>
                    </xsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:when test="@type='boolean_txt'">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <td class="row">
                    <xsl:choose>
                      <xsl:when test="{$valsrcprm}='true'">
                        <xsl:text><gxsl:value-of select="translate($dict/Text[@tid='Yes']/Value[@lang=$lang],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/></xsl:text>
                      </xsl:when>
                      <xsl:when test="{$valsrcprm}='false'">
                        <xsl:text><gxsl:value-of select="translate($dict/Text[@tid='No']/Value[@lang=$lang],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/></xsl:text>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:text>&#160;</xsl:text>
                      </xsl:otherwise>
                    </xsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:when test="@type='url'">
                  <td class="row">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">
                        <xsl:value-of select="@{@nicknamelow}" disable-output-escaping="yes"/>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <xsl:value-of select="{@nickname}" disable-output-escaping="yes"/>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:when test="@fetchtype='external' and @ref and @ref!='' and @extwork and @extwork!=''">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <gxsl:choose>
                    <gxsl:when test="not(RefProp)">
                      <td class="row">
                        <a class="text" href="../{{substring-before(/DPOutput/@package,'.')}}.{@extwork}/?dp=edit&amp;{@refprop}={{{$valsrcprm}}}" target="_blank" style="cursor:pointer">
                          <xsl:value-of select="{$valsrcprm}"/>
                        </a>
                      </td>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <gxsl:for-each select="RefProp">
                        <gxsl:variable name="valsrcrefprm">
                          <gxsl:choose>
                            <gxsl:when test="@attr='1'">@<gxsl:value-of select="@nicknamelow"/></gxsl:when>
                            <gxsl:otherwise><gxsl:value-of select="@nickname"/></gxsl:otherwise>
                          </gxsl:choose>
                        </gxsl:variable>
                        <td class="row">
                          <a class="text" href="../{{substring-before(/DPOutput/@package,'.')}}.{../@extwork}/?dp=edit&amp;{../@refprop}={{{$valsrcprm}}}" target="_blank" style="cursor:pointer">
                            <xsl:value-of select="{$valsrcrefprm}"/>
                          </a>
                        </td>
                      </gxsl:for-each>
                    </gxsl:otherwise>
                  </gxsl:choose>
                </gxsl:when>
                <gxsl:when test="not(RefProp)">
                  <td class="row">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">
                        <xsl:value-of select="@{@nicknamelow}"/>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <xsl:value-of select="{@nickname}"/>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </td>
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:for-each select="RefProp">
                    <td class="row">
                      <gxsl:choose>
                        <gxsl:when test="@attr='true'">
                          <xsl:value-of select="@{@nicknamelow}"/>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <xsl:value-of select="{@nickname}"/>
                        </gxsl:otherwise>
                      </gxsl:choose>
                    </td>
                  </gxsl:for-each>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:when>

            <gxsl:when test="@onedit='show'">
              <gxsl:choose>

                <gxsl:when test="CPStaticValues">
                  <td class="row">
                    <xsl:variable name="value">
                      <gxsl:choose>
                        <gxsl:when test="@attr='1'">
                          <xsl:value-of select="@{@nicknamelow}"/>
                        </gxsl:when>
                        <gxsl:otherwise>
                          <xsl:value-of select="{@nickname}"/>
                        </gxsl:otherwise>
                      </gxsl:choose>
                    </xsl:variable>
                    <select size="1" name="{@formcode}" class="editlist_input_field" onchange='changed();'>
                      <option value="">--- <gxsl:value-of select="$dict/Text[@tid='choose_one']/Value[@lang=$lang]"/> ---</option>
                      <gxsl:for-each select="CPStaticValues/CPStaticValue">
                        <option value='{statval}'>
                          <xsl:if test="$value='{statval}'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                          <gxsl:value-of select="title"/>
                        </option>                    
                      </gxsl:for-each>
                    </select>
                    <gxsl:variable name="vals">
                      <gxsl:for-each select="CPStaticValues/CPStaticValue">#@#<gxsl:value-of select="statval"/>#@#</gxsl:for-each>                  
                    </gxsl:variable>
                    <xsl:if test="not(contains('{$vals}',concat('#@#',$value,'#@#')))">
                      <xsl:text>&#160;</xsl:text><span class="warning"><xsl:value-of select="$value"/></span>
                    </xsl:if>
                  </td>
                </gxsl:when>
              
                <gxsl:when test="@fetchtype='direct' and @ref and @ref!=''">
                  <xsl:variable name="selected">
                    <xsl:choose>
                      <xsl:when test="@{@nicknamelow}">
                        <xsl:value-of select="@{@nicknamelow}"/>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="{@nicknamelow}"/>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:variable>
                  <td class="row">
                  <select size="1" name="{@formcode}" class="editlist_input_field" onchange='itemchanged(this.form);'>
                    <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                    <gxsl:if test="@mandat!='1'">
                      <option value=" ">--- <gxsl:value-of select="$dict/Text[@tid='choose_one']/Value[@lang=$lang]"/> ---</option>
                    </gxsl:if>
                    <xsl:for-each select="../../Opts/{@refconceptcoll}/{@refconcept}">
                      <option>
                        <gxsl:choose>
                          <gxsl:when test="@attr='1'">
                            <xsl:attribute name="value"><xsl:value-of select="@{@refproplow}"/></xsl:attribute>
                          </gxsl:when>
                          <gxsl:otherwise>
                            <xsl:attribute name="value"><xsl:value-of select="{@refprop}"/></xsl:attribute>
                          </gxsl:otherwise>
                        </gxsl:choose>
                        <gxsl:choose>
                          <gxsl:when test="@attr='1'">
                            <xsl:if test="@{@refproplow}=$selected">
                              <xsl:attribute name="selected">yes</xsl:attribute>
                            </xsl:if>
                          </gxsl:when>
                          <gxsl:otherwise>
                            <xsl:if test="{@refprop}=$selected">
                              <xsl:attribute name="selected">yes</xsl:attribute>
                            </xsl:if>
                          </gxsl:otherwise>
                        </gxsl:choose>
                        <gxsl:choose>
                          <gxsl:when test="RefProp">
                            <gxsl:for-each select="RefProp">
                              <gxsl:choose>
                                <gxsl:when test="@attr='1'">
                                  <gxsl:if test="position()!=1"><xsl:if test="@{@lowcode} and @{@lowcode}!=''">,&#160;</xsl:if></gxsl:if>
                                  <xsl:value-of select="@{@lowcode}"/>
                                </gxsl:when>
                                <gxsl:otherwise>
                                  <gxsl:if test="position()!=1"><xsl:if test="{@code} and {@code}!=''">,&#160;</xsl:if></gxsl:if>
                                  <xsl:value-of select="{@code}"/>
                                </gxsl:otherwise>
                              </gxsl:choose>
                            </gxsl:for-each>
                          </gxsl:when>
                          <gxsl:otherwise>
                            <xsl:value-of select="@{@refproplow}"/>
                          </gxsl:otherwise>
                        </gxsl:choose>
                      </option>
                    </xsl:for-each>
                  </select>
                  </td>
                </gxsl:when>

                <gxsl:when test="@fetchtype='external' and @ref and @ref!=''">
                  <gxsl:choose>
                    <gxsl:when test="@extwork and @extwork!=''">
                      <gxsl:variable name="position"><gxsl:value-of select="position()"/></gxsl:variable>

                      <td class="row">
                        <nobr>
                        
                        <xsl:variable name="val">
                          <gxsl:choose>
                            <gxsl:when test="@attr='1'">
                              <xsl:value-of select="@{@nicknamelow}"/>
                            </gxsl:when>
                            <gxsl:otherwise>
                              <xsl:value-of select="{@nickname}"/>
                            </gxsl:otherwise>
                          </gxsl:choose>
                        </xsl:variable>

                        <xsl:variable name="lblselect">
                          <gxsl:choose>
                            <gxsl:when test="@type='int'">
                              <xsl:choose>
                                <xsl:when test="$val=''">select</xsl:when>
                                <xsl:otherwise>deselect</xsl:otherwise>
                              </xsl:choose>
                            </gxsl:when>
                            <gxsl:otherwise>
                              <xsl:choose>
                                <xsl:when test="$val=''">select</xsl:when>
                                <xsl:otherwise>deselect</xsl:otherwise>
                              </xsl:choose>
                            </gxsl:otherwise>
                          </gxsl:choose>
                        </xsl:variable>

                        <xsl:variable name="lblval">
                          <gxsl:choose>
                            <gxsl:when test="@mandat='1'">
                              <gxsl:value-of select="$dict/Text[@tid='select']/Value[@lang=$lang]"/>
                            </gxsl:when>
                            <gxsl:otherwise>
                              <xsl:choose>
                                <xsl:when test="$lblselect='select'"><gxsl:value-of select="$dict/Text[@tid='select']/Value[@lang=$lang]"/></xsl:when>
                                <xsl:otherwise><gxsl:value-of select="$dict/Text[@tid='deselect']/Value[@lang=$lang]"/></xsl:otherwise>
                              </xsl:choose>
                            </gxsl:otherwise>
                          </gxsl:choose>
                        </xsl:variable>

                        <xsl:choose>
                          <xsl:when test="$lblselect='select'">
                            <input type="hidden" name="{@formcode}" value=" "/>
                            <input class="external_selection_edtlist" readonly="true" type="text" size="1" onkeyup="itemchanged(this.form);" value=" ">
                              <gxsl:attribute name="name">label<gxsl:value-of select="position()"/></gxsl:attribute>
                            </input>
                          </xsl:when>
                          <xsl:otherwise>
                            <input type="hidden" name="{@formcode}" value="{{$val}}"/>
                            <input class="external_selection_edtlist" readonly="true" type="text" size="1" onkeyup="itemchanged(this.form);" value="{{$val}}">
                              <gxsl:attribute name="name">label<gxsl:value-of select="position()"/></gxsl:attribute>
                            </input>
                          </xsl:otherwise>
                        </xsl:choose>

                        <xsl:if test="/DPOutput/@access!='r'">
                          <input class="external_selection_button_edtlist" type="button" onchange="itemchanged(this.form);" value="{{$lblval}}">
                            <gxsl:attribute name="name">button<gxsl:value-of select="position()"/></gxsl:attribute>
                            <xsl:attribute name="onclick">add<gxsl:value-of select="position()"/>(<xsl:value-of select="position()"/>)</xsl:attribute>
                          </input>
                        </xsl:if>

                        <input type="hidden" value="{{$lblselect}}">
                          <gxsl:attribute name="name">buttonstate<gxsl:value-of select="position()"/></gxsl:attribute>
                        </input>

                        <input class="external_selection_button_edtlist" type="button">
                          <gxsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='view']/Value[@lang=$lang]"/></gxsl:attribute>
                          <gxsl:attribute name="name">vbutton<gxsl:value-of select="position()"/></gxsl:attribute>
                          <xsl:attribute name="onclick">view<gxsl:value-of select="position()"/>(<xsl:value-of select="position()"/>)</xsl:attribute>
                          <xsl:choose>
                            <xsl:when test="$lblselect='select'">
                              <xsl:attribute name="disabled">yes</xsl:attribute>
                            </xsl:when>
                          </xsl:choose>
                        </input>

                        <script language="JavaScript" type="text/javascript">
                          <xsl:comment>
                            <![CDATA[
                              function add]]><gxsl:value-of select="position()"/><![CDATA[(position)
                              {
                                var f;
                                var i=0;
                                for (j=0;j<document.forms.length;j++) if (document.forms[j].name=='edtitem') i++;
                                if (i==1) f=document.edtitem; else f=document.edtitem[position-1];
                                //var f=document.edtitem[position-1];

                                if (f.buttonstate]]><gxsl:value-of select="position()"/><![CDATA[.value=="select") {
                                  document.forms.action.whichform.value=position;
                                }
                            ]]>

                            <gxsl:if test="@mandat='0'">
                              <![CDATA[
                                if (f.buttonstate]]><gxsl:value-of select="position()"/><![CDATA[.value=="select") {
                              ]]>
                            </gxsl:if>

                            <![CDATA[
                                  var path="../]]><xsl:value-of select="substring-before(/DPOutput/@package,'.')"/>.<gxsl:value-of select="@extwork"/>/?select=<gxsl:value-of select="@formcode"/>&amp;ssnctl=hdrext&amp;allowmulti=0<![CDATA[";
                                  var sFeatures = "dependent=yes,toolbar=no,scrollbars=yes,location=no,status=no,resizable=yes,height="+document.body.clientHeight+",width="+document.body.clientWidth+",top="+window.screenTop+",left="+window.screenLeft;
                                  window.open(path,"external",sFeatures);
                            ]]>

                            <gxsl:if test="@mandat='0'">
                              <![CDATA[
                                } else {
                                  //var f=document.edtitem[position-1];
                                  f.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=" ";
                                  f.label]]><gxsl:value-of select="position()"/><![CDATA[.value="";
                                  itemchanged(f);
                              ]]>
                              <gxsl:for-each select="RefProp">
                                <![CDATA[
                                  f.reflabel]]><gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/><![CDATA[.value="";
                                ]]>
                              </gxsl:for-each>
                              <![CDATA[
                                  f.buttonstate]]><gxsl:value-of select="position()"/><![CDATA[.value="select";
                                  f.vbutton]]><gxsl:value-of select="position()"/><![CDATA[.disabled="yes";
                                  f.button]]><gxsl:value-of select="position()"/><![CDATA[.value="]]><gxsl:value-of select="$dict/Text[@tid='select']/Value[@lang=$lang]"/><![CDATA[";
                                  itemchanged(f);
                                }
                              ]]>
                            </gxsl:if>

                            <![CDATA[
                              }

                              function view]]><gxsl:value-of select="position()"/><![CDATA[(position)
                              {
                                var f;
                                var i=0;
                                for (j=0;j<document.forms.length;j++) if (document.forms[j].name=='edtitem') i++;
                                if (i==1) f=document.edtitem; else f=document.edtitem[position-1];
                                //var f=document.edtitem[position-1];
                                var path="../]]><xsl:value-of select="substring-before(/DPOutput/@package,'.')"/>.<gxsl:value-of select="@extwork"/>/?dp=edit&amp;<gxsl:value-of select="@refprop"/>="+f.<gxsl:value-of select="@formcode"/>.value<![CDATA[;
                                window.open(path, "normal","toolbar=yes,scrollbars=yes,location=yes,status=yes,resizable=yes");

                              }

                              function ]]><gxsl:value-of select="@formcode"/><![CDATA[(key,]]><gxsl:for-each select="RefProp"> reflabel<gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/>,</gxsl:for-each> dummy, position<![CDATA[)
                              {
                                var f;
                                var i=0;
                                for (j=0;j<document.forms.length;j++) if (document.forms[j].name=='edtitem') i++;
                                if (i==1) f=document.edtitem; else f=document.edtitem[document.forms.action.whichform.value-1];
                                //var f=document.edtitem[document.forms.action.whichform.value-1];
                                f.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=key;
                                f.label]]><gxsl:value-of select="position()"/><![CDATA[.value=key;
                                document.forms.action.ssnctl.value="hdrnrm";//f.ssnctl.value="hdrnrm";
                                itemchanged(f);
                            ]]>

                            <gxsl:for-each select="RefProp">
                              <![CDATA[
                                f.reflabel]]><gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/><![CDATA[.value=reflabel]]><gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/><![CDATA[;
                              ]]>
                            </gxsl:for-each>

                            <![CDATA[
                                itemchanged(f);
                            ]]>

                            <gxsl:if test="@mandat='0'">
                              <![CDATA[
                                f.buttonstate]]><gxsl:value-of select="position()"/><![CDATA[.value="deselect";
                                f.vbutton]]><gxsl:value-of select="position()"/><![CDATA[.disabled="";
                                f.button]]><gxsl:value-of select="position()"/><![CDATA[.value="]]><gxsl:value-of select="$dict/Text[@tid='deselect']/Value[@lang=$lang]"/><![CDATA[";
                              ]]>
                            </gxsl:if>

                            <![CDATA[
                                window.focus();
                              }
                            ]]>
                          //</xsl:comment>
                        </script>

                        </nobr>
                      </td>
                      <gxsl:for-each select="RefProp">
                        <td class="row">
                          <input class="external_selection_edtlist" readonly="true" type="text" onkeyup='itemchanged(this.form);'>
                            <gxsl:attribute name="name">reflabel<gxsl:value-of select="$position"/>_<gxsl:value-of select="position()"/></gxsl:attribute>
                            <gxsl:attribute name="size"><gxsl:choose><gxsl:when test="number(@len) &gt; 20">20</gxsl:when><gxsl:otherwise><gxsl:value-of select="@len"/></gxsl:otherwise></gxsl:choose></gxsl:attribute>
                            <xsl:attribute name="value">
                              <gxsl:choose>
                                <gxsl:when test="@attr='1'">
                                  <xsl:value-of select="@{@nicknamelow}"/>
                                </gxsl:when>
                                <gxsl:otherwise>
                                  <xsl:value-of select="{@nickname}"/>
                                </gxsl:otherwise>
                              </gxsl:choose>
                            </xsl:attribute>
                          </input>
                        </td>
                      </gxsl:for-each>
                    </gxsl:when>

                    <gxsl:otherwise>
                      <gxsl:choose>
                        <gxsl:when test="RefProp">
                          <gxsl:for-each select="RefProp">
                            <td class="row">
                              <gxsl:choose>
                                <gxsl:when test="@attr='1'">
                                  <xsl:value-of select="@{@nicknamelow}"/>
                                </gxsl:when>
                                <gxsl:otherwise>
                                  <xsl:value-of select="{@nickname}"/>
                                </gxsl:otherwise>
                              </gxsl:choose>
                            </td>
                          </gxsl:for-each>
                        </gxsl:when>

                        <gxsl:otherwise>
                          <td class="row">
                            <gxsl:choose>
                              <gxsl:when test="@attr='1'">
                                <xsl:value-of select="@{@nicknamelow}"/>
                              </gxsl:when>
                              <gxsl:otherwise>
                                <xsl:value-of select="{@nickname}"/>
                              </gxsl:otherwise>
                            </gxsl:choose>
                          </td>
                        </gxsl:otherwise>
                      </gxsl:choose>
                    </gxsl:otherwise>
                  </gxsl:choose>
                </gxsl:when>

                <gxsl:when test="@type='boolean'">
                  <gxsl:choose>
                    <gxsl:when test="@attr='1'">
                      <xsl:variable name="value"><xsl:value-of select="@{@nicknamelow}"/></xsl:variable>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <xsl:variable name="value"><xsl:value-of select="{@nickname}"/></xsl:variable>
                    </gxsl:otherwise>
                  </gxsl:choose>
                  <td class="row">
                  <gxsl:choose>
                    <gxsl:when test="@mandat='1'">
                      <center>
                      <input name="{@formcode}" id="{@formcode}" type="hidden" value="{{$value}}"/>
                      <input type="checkbox" onclick="this.form.{@formcode}.value = (this.form.{@formcode}.value == 0 ? 1 : 0); itemchanged(this.form);">
                        <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                        <xsl:if test="$value='1'">
                          <xsl:attribute name="checked">true</xsl:attribute>
                        </xsl:if>
                      </input>
                      </center>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <select size="1" name="{@formcode}" class="editlist_input_field" onchange="itemchanged(this.form);">
                      <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                      <gxsl:if test="@mandat!='1'">
                        <option value=" ">---</option>
                      </gxsl:if>
                        <option value="1">
                          <xsl:if test="$value='1'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                          <gxsl:value-of select="$dict/Text[@tid='Yes']/Value[@lang=$lang]"/>
                        </option>
                        <option value="0">
                          <xsl:if test="$value='0'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                          <gxsl:value-of select="$dict/Text[@tid='No']/Value[@lang=$lang]"/>
                        </option>
                      </select>
                    </gxsl:otherwise>
                  </gxsl:choose>
                  </td>
                </gxsl:when>

                <gxsl:when test="@type='boolean_txt'">
                  <gxsl:choose>
                    <gxsl:when test="@attr='1'">
                      <xsl:variable name="value"><xsl:value-of select="@{@nicknamelow}"/></xsl:variable>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <xsl:variable name="value"><xsl:value-of select="{@nickname}"/></xsl:variable>
                    </gxsl:otherwise>
                  </gxsl:choose>
                  <td class="row">
                  <gxsl:choose>
                    <gxsl:when test="@mandat='1'">
                      <center>
                      <input name="{@formcode}" id="{@formcode}" type="hidden" value="{{$value}}"/>
                      <input type="checkbox" onclick="this.form.{@formcode}.value = (this.form.{@formcode}.value == 'false' ? 'true' : 'false'); itemchanged(this.form);">
                        <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                        <xsl:if test="$value='true'">
                          <xsl:attribute name="checked">true</xsl:attribute>
                        </xsl:if>
                      </input>
                      </center>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <select size="1" name="{@formcode}" class="editlist_input_field" onchange="itemchanged(this.form);">
                      <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                      <gxsl:if test="@mandat!='1'">
                        <option value=" ">---</option>
                      </gxsl:if>
                        <option value="true">
                          <xsl:if test="$value='true'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                          <gxsl:value-of select="$dict/Text[@tid='Yes']/Value[@lang=$lang]"/>
                        </option>
                        <option value="false">
                          <xsl:if test="$value='false'">
                            <xsl:attribute name="selected">yes</xsl:attribute>
                          </xsl:if>
                          <gxsl:value-of select="$dict/Text[@tid='No']/Value[@lang=$lang]"/>
                        </option>
                      </select>
                    </gxsl:otherwise>
                  </gxsl:choose>
                  </td>
                </gxsl:when>

                <gxsl:when test="@type='url'">
                  <td class="row">
                  <xsl:variable name="urlsource">
                    <gxsl:choose>
                      <gxsl:when test="@attr='1'">
                        <xsl:value-of select="@{@nicknamelow}"/>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <xsl:value-of select="{@nickname}"/>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </xsl:variable>

                  <xsl:variable name="urlsource" select="substring-after($urlsource,'&lt;a href=&quot;')"/>

                  <xsl:variable name="urlpart">
                    <xsl:choose>
                      <xsl:when test="starts-with($urlsource,'http://')">
                        <xsl:value-of select="'http://'"/>
                      </xsl:when>
                      <xsl:when test="starts-with($urlsource,'https://')">
                        <xsl:value-of select="'https://'"/>
                      </xsl:when>
                      <xsl:when test="starts-with($urlsource,'ftp://')">
                        <xsl:value-of select="'ftp://'"/>
                      </xsl:when>
                      <xsl:when test="starts-with($urlsource,'mailto:')">
                        <xsl:value-of select="'mailto:'"/>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="''"/>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:variable>

                  <select size="1" class="editlist_input_field">
                    <gxsl:attribute name="onchange">composeurl<gxsl:value-of select="position()"/>(this.form);</gxsl:attribute>
                    <gxsl:attribute name="name"><gxsl:value-of select="concat(@formcode,'xprotocol')"/></gxsl:attribute>
                    <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                    <option value="">
                      <xsl:if test="$urlpart=''">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                    </option>
                    <option value="http://">
                      <xsl:if test="$urlpart='http://'">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                      http://
                    </option>
                    <option value="https://">
                      <xsl:if test="$urlpart='https://'">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                      https://
                    </option>
                    <option value="ftp://">
                      <xsl:if test="$urlpart='ftp://'">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                      ftp://
                    </option>
                    <option value="mailto:">
                      <xsl:if test="$urlpart='mailto:'">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                      mailto:
                    </option>
                  </select>

                  <xsl:variable name="urlsource" select="substring-after($urlsource,$urlpart)"/>

                  <input class="editlist_input_field" type="text" size="20">
                    <gxsl:attribute name="onkeyup">composeurl<gxsl:value-of select="position()"/>(this.form);</gxsl:attribute>
                    <gxsl:attribute name="name"><gxsl:value-of select="concat(@formcode,'xaddress')"/></gxsl:attribute>
                    <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                    <xsl:attribute name="value"><xsl:value-of select="substring-before($urlsource,'&quot;&gt;')"/></xsl:attribute>
                  </input>

                  <xsl:variable name="urlsource" select="substring-before(substring-after($urlsource,'&quot;&gt;'),'&lt;/a&gt;')"/>

                  <input class="editlist_input_field" type="text" size="20">
                    <gxsl:attribute name="onkeyup">composeurl<gxsl:value-of select="position()"/>(this.form);</gxsl:attribute>
                    <gxsl:attribute name="name"><gxsl:value-of select="concat(@formcode,'xcomment')"/></gxsl:attribute>
                    <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                    <xsl:attribute name="value"><xsl:value-of select="$urlsource"/></xsl:attribute>
                  </input>

                  <br/>

                  <gxsl:choose>
                    <gxsl:when test="@attr='1'">
                      <input class="input_field" type="hidden" name="{@formcode}" value="{{@{@nicknamelow}}}"/>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <input class="input_field" type="hidden" name="{@formcode}" value="{{{@nickname}}}"/>
                    </gxsl:otherwise>
                  </gxsl:choose>

                  </td>

                  <script language="JavaScript" type="text/javascript">
                    <xsl:comment>

                      <![CDATA[

                        function composeurl]]><gxsl:value-of select="position()"/><![CDATA[(form)
                        {

                          itemchanged(form);

                          form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value='<a href="'+form.]]><gxsl:value-of select="concat(@formcode,'xprotocol')"/><![CDATA[.value+form.]]><gxsl:value-of select="concat(@formcode,'xaddress')"/><![CDATA[.value+'">';

                          if (form.]]><gxsl:value-of select="concat(@formcode,'xcomment')"/><![CDATA[.value=='') {
                            form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value+=form.]]><gxsl:value-of select="concat(@formcode,'xprotocol')"/><![CDATA[.value+form.]]><gxsl:value-of select="concat(@formcode,'xaddress')"/><![CDATA[.value+'</a>';
                          } else {
                            form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value+=form.]]><gxsl:value-of select="concat(@formcode,'xcomment')"/><![CDATA[.value+'</a>';
                          }

                          if (form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=='<a href=""></a>') {
                            form.]]><gxsl:value-of select="@formcode"/><![CDATA[.value=' ';
                          }

                        }
                      ]]>

                    //</xsl:comment>
                  </script>
                </gxsl:when>

                <gxsl:otherwise>
                  <td class="row" nowrap="true">
                    <gxsl:choose>
                      <gxsl:when test="$enum='true'">
                        <xsl:call-template name="buildOptions">
                          <xsl:with-param name="formcode" select="'{@formcode}'"/>
                          <gxsl:choose>
                            <gxsl:when test="@attr='1'">
                              <xsl:with-param name="val" select="@{@nicknamelow}"/>
                            </gxsl:when>
                            <gxsl:otherwise>
                              <xsl:with-param name="val" select="{@nickname}"/>
                            </gxsl:otherwise>
                          </gxsl:choose>
                        </xsl:call-template>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <input type="text" name="{@formcode}" class="editlist_input_field" onkeyup='itemchanged(this.form);'>
                          <xsl:if test="/DPOutput/@access='r'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
                          <xsl:attribute name="value">
                            <gxsl:choose>
                              <gxsl:when test="@attr='1'">
                                <xsl:value-of select="@{@nicknamelow}"/>
                              </gxsl:when>
                              <gxsl:otherwise>
                                <xsl:value-of select="{@nickname}"/>
                              </gxsl:otherwise>
                            </gxsl:choose>
                          </xsl:attribute>
                          <xsl:attribute name="size">
                            <gxsl:choose>
                              <gxsl:when test="@len='0' or @len=''">6</gxsl:when>
                              <gxsl:when test="number(@len) &gt; 30">30</gxsl:when>
                              <gxsl:otherwise><gxsl:value-of select="@len"/></gxsl:otherwise>
                            </gxsl:choose>
                          </xsl:attribute>
                        </input>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </td>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:when>
          </gxsl:choose>
        </gxsl:for-each>

<!-- -->
        <gxsl:for-each select="Schedules/UpdateSchedule/SchedItem[@base='0']">
          <gxsl:for-each select="../../..//CVInclude[@virtual='1' and @rootnickpath=current()/@rootnickpath]/CVIProperties/CVIProperty[@key='1']">
            <gxsl:if test="not($cvinclude/CVIProperties/CVIProperty[@id_cproperty=current()/@id_cproperty])">
              <input name="{@formcode}" type="hidden">
                <gxsl:attribute name="value">{@<gxsl:for-each select="ancestor::CVInclude[ancestor::CVInclude[@id_cvinclude=$cvinclude/@id_cvinclude]]"><gxsl:sort select="count(ancestor::CVInclude)" data-type="number" order="ascending"/><gxsl:value-of select="@nicknamelow"/>.</gxsl:for-each><gxsl:value-of select="@nicknamelow"/>}</gxsl:attribute>
              </input>
            </gxsl:if>
          </gxsl:for-each>
        </gxsl:for-each>
<!-- -->

        <gxsl:if test="@update='1'">
          <td class="row">
          <a>
            <xsl:attribute name="href">?dp=edit<gxsl:value-of select="@id_cvinclude"/>
              <gxsl:for-each select="Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<xsl:value-of select="@{@propertylow}"/></gxsl:for-each>
              <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>=<xsl:value-of select="/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
              <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                  <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                </gxsl:if>
              </gxsl:for-each>
            </xsl:attribute>
            <b>
              <gxsl:choose>
                <gxsl:when test="@update='1'">
                  <xsl:choose>
                    <xsl:when test="/DPOutput/@access!='r'"><gxsl:value-of select="$dict/Text[@tid='edt']/Value[@lang=$lang]"/></xsl:when>
                    <xsl:otherwise><gxsl:value-of select="$dict/Text[@tid='detail']/Value[@lang=$lang]"/></xsl:otherwise>
                  </xsl:choose>                  
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:value-of select="$dict/Text[@tid='detail']/Value[@lang=$lang]"/>
                </gxsl:otherwise>
              </gxsl:choose>
            </b>
          </a>
          </td>
        </gxsl:if>
        <gxsl:if test="@update='0' and @detail='1'">
          <td class="row">
          <a>
            <xsl:attribute name="href">?dp=edit<gxsl:value-of select="@id_cvinclude"/><gxsl:for-each select="Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<xsl:value-of select="@{@propertylow}"/></gxsl:for-each>
              <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>=<xsl:value-of select="/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
              <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                  <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                </gxsl:if>
              </gxsl:for-each>
            </xsl:attribute>
            <b><gxsl:value-of select="$dict/Text[@tid='detail']/Value[@lang=$lang]"/></b>
          </a>
          </td>
        </gxsl:if>
        <gxsl:if test="@delete='1'">
          <xsl:if test="/DPOutput/@access!='r'">
            <gxsl:choose>
              <gxsl:when test="@required='-'">
                <xsl:if test="/DPOutput/DPList/DPPage/@total!=1">
                  <td class="row">
                    <a>
                      <xsl:attribute name="href">?dp=remove<gxsl:value-of select="@id_cvinclude"/><gxsl:for-each select="Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<xsl:value-of select="@{@propertylow}"/></gxsl:for-each>
                        <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>=<xsl:value-of select="/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
                        <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                          <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                          <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                            <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                          </gxsl:if>
                        </gxsl:for-each>
                      </xsl:attribute>
                      <b><gxsl:value-of select="$dict/Text[@tid='rmv']/Value[@lang=$lang]"/></b>
                    </a>
                  </td>
                </xsl:if>
              </gxsl:when>
              <gxsl:otherwise>
                <td class="row">
                  <a>
                    <xsl:attribute name="href">?dp=remove<gxsl:value-of select="@id_cvinclude"/><gxsl:for-each select="Keys/Binding">&amp;<gxsl:value-of select="@property"/>=<xsl:value-of select="@{@propertylow}"/></gxsl:for-each>
                      <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>=<xsl:value-of select="/DPOutput/DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
                      <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                        <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                        <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                          <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="/DPOutput/DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                        </gxsl:if>
                      </gxsl:for-each>
                    </xsl:attribute>
                    <b><gxsl:value-of select="$dict/Text[@tid='rmv']/Value[@lang=$lang]"/></b>
                  </a>
                </td>
              </gxsl:otherwise>
            </gxsl:choose>
          </xsl:if>
        </gxsl:if>

        <xsl:if test="not($root/@selectfun='no')">
          <td class="row">
          <a>
            <xsl:attribute name="href">JavaScript: select(<gxsl:for-each select="Keys/Binding">'<xsl:value-of select="@{@propertylow}"/>',</gxsl:for-each>
            <gxsl:for-each select="CVIProperties/CVIProperty[PropGroup/@basegroup='true' and @onlabel='1']">'<gxsl:choose>
              <gxsl:when test="@attr='1'">
                 <xsl:value-of select="@{@lowname}"/>
              </gxsl:when>
              <gxsl:otherwise>
                <xsl:value-of select="{@name}"/>
              </gxsl:otherwise>
              </gxsl:choose>',</gxsl:for-each>'dummy')</xsl:attribute>

            <b><gxsl:value-of select="$dict/Text[@tid='select']/Value[@lang=$lang]"/></b>
          </a>
          </td>
        </xsl:if>

        <gxsl:choose>
          <gxsl:when test="@delete='1' and @deletecoll='1'">
            <xsl:if test="/DPOutput/@access!='r'">
              <gxsl:choose>
                <gxsl:when test="@required='-'">
                  <xsl:if test="/DPOutput/DPList/DPPage/@total!=1 or ($root/@selectfun and $root/@selectfun!='' and $root/@selectfun!='no' and $root/@allowmulti='1')">
                    <td>
                      <center>
                        <input type="checkbox" name="selected" onclick="computeSelection();" class="input_filter"/>
                      </center>
  
                      <gxsl:for-each select="Keys/Binding[1]">
                        <gxsl:variable name="valsrcprm">
                          <gxsl:choose>
                            <gxsl:when test="@inattr='1'">@<gxsl:value-of select="@propertylow"/></gxsl:when>
                            <gxsl:otherwise><gxsl:value-of select="property"/></gxsl:otherwise>
                          </gxsl:choose>
                        </gxsl:variable>
                        <input type="hidden" name="key" value="{{{$valsrcprm}}}"/>
                      </gxsl:for-each>
                    </td>
                  </xsl:if>
                </gxsl:when>
                <gxsl:otherwise>
                  <td>
                    <center>
                      <input type="checkbox" name="selected" onclick="computeSelection();" class="input_filter"/>
                    </center>
  
                    <gxsl:for-each select="Keys/Binding[1]">
                      <gxsl:variable name="valsrcprm">
                        <gxsl:choose>
                          <gxsl:when test="@inattr='1'">@<gxsl:value-of select="@propertylow"/></gxsl:when>
                          <gxsl:otherwise><gxsl:value-of select="property"/></gxsl:otherwise>
                        </gxsl:choose>
                      </gxsl:variable>
                      <input type="hidden" name="key" value="{{{$valsrcprm}}}"/>
                    </gxsl:for-each>
                  </td>
                </gxsl:otherwise>
              </gxsl:choose>
            </xsl:if>
          </gxsl:when>
          <gxsl:otherwise>
            <xsl:if test="$root/@selectfun and $root/@selectfun!='' and $root/@selectfun!='no' and $root/@allowmulti='1'">
              <td>
                <center>
                  <input type="checkbox" name="selected" onclick="computeSelection();" class="input_filter"/>
                </center>

                <gxsl:for-each select="Keys/Binding[1]">
                  <gxsl:variable name="valsrcprm">
                    <gxsl:choose>
                      <gxsl:when test="@inattr='1'">@<gxsl:value-of select="@propertylow"/></gxsl:when>
                      <gxsl:otherwise><gxsl:value-of select="property"/></gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <input type="hidden" name="key" value="{{{$valsrcprm}}}"/>
                </gxsl:for-each>
              </td>
            </xsl:if>
          </gxsl:otherwise>
        </gxsl:choose>

      </tr>
    </form>

  </xsl:template>

  <xsl:template match="DPPage">
    <xsl:if test="@prev or @next">
      <xsl:if test="@prev">
        <a>
          <xsl:attribute name="href">?dp=<xsl:value-of select="/DPOutput/@dataport"/>&amp;<xsl:value-of select="@doc"/><xsl:text>.start=1</xsl:text>
            <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
              </gxsl:if>
            </gxsl:for-each>
            <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
              </gxsl:if>
            </gxsl:for-each>
          </xsl:attribute>
          <gxsl:value-of select="$dict/Text[@tid='first']/Value[@lang=$lang]"/>
        </a>
      </xsl:if>
      <xsl:if test="not(@prev)">
        <b><gxsl:value-of select="$dict/Text[@tid='first']/Value[@lang=$lang]"/></b>
      </xsl:if>
      |
      <xsl:apply-templates select="Link"/>

      <xsl:if test="@next">
        <a>
          <xsl:attribute name="href">?dp=<xsl:value-of select="/DPOutput/@dataport"/>&amp;<xsl:value-of select="@doc"/>.start=<xsl:value-of select="@last"/>
            <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
              <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
              </gxsl:if>
            </gxsl:for-each>
            <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
              <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
              <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
              </gxsl:if>
            </gxsl:for-each>
          </xsl:attribute>
          <gxsl:value-of select="$dict/Text[@tid='last']/Value[@lang=$lang]"/>
        </a>
      </xsl:if>
      <xsl:if test="not(@next)">
        <b><gxsl:value-of select="$dict/Text[@tid='last']/Value[@lang=$lang]"/></b>
      </xsl:if>
      <div><gxsl:value-of select="$dict/Text[@tid='total']/Value[@lang=$lang]"/><xsl:text>&#160;</xsl:text><xsl:value-of select="@total"/><xsl:text>&#160;</xsl:text><gxsl:value-of select="$dict/Text[@tid='records']/Value[@lang=$lang]"/>.</div>

    </xsl:if>

  </xsl:template>


  <xsl:template match="Link">
    <xsl:if test="@here">
      <b><xsl:value-of select="@upto"/></b>
    </xsl:if>
    <xsl:if test="not(@here)">
      <a>
        <xsl:attribute name="href">?dp=<xsl:value-of select="/DPOutput/@dataport"/>&amp;<xsl:value-of select="../@doc"/>.start=<xsl:value-of select="@at"/>
          <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
            <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
              <xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
            </gxsl:if>
          </gxsl:for-each>
          <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
            <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
            <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
              <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../../../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
            </gxsl:if>
          </gxsl:for-each>
        </xsl:attribute>
        <xsl:choose>
          <xsl:when test="@big='yes'">
            <b><xsl:value-of select="@upto"/></b>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="@upto"/>
          </xsl:otherwise>
        </xsl:choose>
      </a>
    </xsl:if>
    |
  </xsl:template>

  <xsl:template name="title"><gxsl:value-of select="ancestor::CView/CVTitles/CVTitle/Title"/></xsl:template>

  <xsl:template match="DPFilter">
    <xsl:param name="propcols"/>
    <xsl:param name="othercols"/>

    <script language="JavaScript" type="text/javascript" src="{{/DPOutput/@cpath}}/sta/{{/DPOutput/@repository}}/fnc/mambo.js"/>
    <script language="JavaScript" type="text/javascript">
      <xsl:comment>
        <![CDATA[
          function checkfilter()
          {
            var form = document.forms.action; ]]>
            <gxsl:for-each select="CVIProperties/CVIProperty[@onfilter='show' or @onlist='show']">
              <gxsl:choose>
                <gxsl:when test="RefProp">
                  <gxsl:for-each select="RefProp">

                    <gxsl:choose>
                      <gxsl:when test="@type='int'">
                        if (!valInt(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                      </gxsl:when>
                      <gxsl:when test="@type='float'">
                        if (!valFloat(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                      </gxsl:when>
                      <gxsl:when test="@type='date'">
                        if (!valDate(form.<gxsl:value-of select="@formcode"/>_from,"<gxsl:value-of select="Title"/>","ISO")) return false;
                        if (!valDate(form.<gxsl:value-of select="@formcode"/>_to,"<gxsl:value-of select="Title"/>","ISO")) return false;
                      </gxsl:when>
                      <gxsl:when test="@type='datetime'">
                        if (!valDate(form.<gxsl:value-of select="@formcode"/>_from,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                        if (!valDate(form.<gxsl:value-of select="@formcode"/>_to,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                      </gxsl:when>
                      <gxsl:when test="@type='timestamp'">
                        if (!valDate(form.<gxsl:value-of select="@formcode"/>_from,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                        if (!valDate(form.<gxsl:value-of select="@formcode"/>_to,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                      </gxsl:when>
                    </gxsl:choose>
                  </gxsl:for-each>
                </gxsl:when>

                <gxsl:otherwise>
                  <gxsl:choose>
                    <gxsl:when test="@type='int'">
                      if (!valInt(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                    </gxsl:when>
                    <gxsl:when test="@type='float'">
                      if (!valFloat(form.<gxsl:value-of select="@formcode"/>,"<gxsl:value-of select="Title"/>")) return false;
                    </gxsl:when>
                    <gxsl:when test="@type='date'">
                      if (!valDate(form.<gxsl:value-of select="@formcode"/>_from,"<gxsl:value-of select="Title"/>","ISO")) return false;
                      if (!valDate(form.<gxsl:value-of select="@formcode"/>_to,"<gxsl:value-of select="Title"/>","ISO")) return false;
                    </gxsl:when>
                    <gxsl:when test="@type='datetime'">
                      if (!valDate(form.<gxsl:value-of select="@formcode"/>_from,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                      if (!valDate(form.<gxsl:value-of select="@formcode"/>_to,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                    </gxsl:when>
                    <gxsl:when test="@type='timestamp'">
                      if (!valDate(form.<gxsl:value-of select="@formcode"/>_from,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                      if (!valDate(form.<gxsl:value-of select="@formcode"/>_to,"<gxsl:value-of select="Title"/>","ISOHms")) return false;
                    </gxsl:when>
                  </gxsl:choose>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:for-each>

        <![CDATA[
            return true;
          }

          function setAstra(elem)
          {
                  //var str=elem.value;
                  //str=delChar(str,"%&;=");
                  //if (str.charAt(str.length-1) != "*" && str.length > 0)
                  //{
                  //       str+="*";
                  //}
                  //elem.value=str;
          }

          function delChar(s,del)
          {
                  var delka=s.length;
                  var pom="";
                  var i=0;

                  while(i<delka)
                  {
                          if(del.indexOf(s.charAt(i)) == -1)
                          {
                                  pom += s.charAt(i);
                          }
                  i++;
                  }
                  return pom;
          }
        ]]>
      //</xsl:comment>
    </script>

    <tr>
      <td colspan="{{1+$propcols+$othercols}}">
        <table cellspacing="0" cellpadding="0" width="100%">
          <tr>
            <td width="50%" align="left">
              <nobr>
              <input type="hidden" name="setfilter" value="no"/>
              <input type="hidden" name="{@concept}.filterfirst" value="0"/>
              <input type="hidden" name="ssnctl" value="hdrnrm"/>
              <input type="hidden" name="whichform"/>

              <input type="button" class="input_filter" onclick="setfilterfnc();">
                <xsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='set_filter']/Value[@lang=$lang]"/></xsl:attribute>&#160;
              </input>

              <script language="JavaScript" type="text/javascript">
                <xsl:comment>
                  <![CDATA[
                    function setfilterfnc() {
                      if (checkfilter()) {
                        document.forms["action"].setfilter.value="yes";
                        document.forms["action"].dp.value="list]]><gxsl:value-of select="@id_cvinclude"/><![CDATA[";
                        document.forms["action"].submit();
                      }
                    }

                    function setpagestepfnc() {
                      document.forms["action"].setfilter.value="no";
                      document.forms["action"].dp.value="list]]><gxsl:value-of select="@id_cvinclude"/><![CDATA[";
                      document.forms["action"].submit();
                    }

                    function checkfiltersubmit(event) {
                      if (event.keyCode==13 || event.which==13) setfilterfnc();
                    }

                    function checkpagestepsubmit(event) {
                      if (event.keyCode==13 || event.which==13) setpagestepfnc();
                    }
                  ]]>
                //</xsl:comment>
              </script>

              <font size="-1"><gxsl:value-of select="$dict/Text[@tid='pagestep']/Value[@lang=$lang]"/>:&#160;</font>
              <input type="text" name="{@concept}.step" size="5" class="input_filter" onkeypress="checkpagestepsubmit(event)">
                <xsl:attribute name="value">
                  <xsl:choose>
                    <xsl:when test="../DPPage">
                      <xsl:value-of select="../DPPage/@step"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="'-1'"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
              </input>
              <input type="hidden" name="{@concept}.start" value="1"/>
              <input type="button" class="input_filter" onclick="setpagestepfnc();">
                <gxsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='change']/Value[@lang=$lang]"/></gxsl:attribute>
              </input>
              </nobr>
            </td>
            <td width="50%" align="right">
              <nobr>
              <xsl:if test="../@filterfirst!='1'">

                <gxsl:if test="@canexport='0' and @canprint='0' and @update='0'">&#160;</gxsl:if>

                <gxsl:if test="@canexport='1'">
                  &#160;&#160;&#160;
                  <font size="-1"><gxsl:value-of select="$dict/Text[@tid='export']/Value[@lang=$lang]"/>: <a target="new">
                  <xsl:attribute name="href">?dp=expxls<gxsl:value-of select="@id_cvinclude"/>
                    <gxsl:for-each select="../CVIRBindings/CVIRBinding"><xsl:text>&amp;<gxsl:value-of select="@p2"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:for-each>
                    <gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding">
                      <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                        <xsl:text>&amp;<gxsl:value-of select="@p1"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/>
                      </gxsl:if>
                    </gxsl:for-each>
                    <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                      <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                      <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                        <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="../../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
                      </gxsl:if>
                    </gxsl:for-each>
                  </xsl:attribute>Excel</a></font>
                </gxsl:if>

                <gxsl:for-each select="../CVIRBindings/CVIRBinding">
                  <input type="hidden" name="{@p1}" value="{{../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}}}"/>
                </gxsl:for-each>

                <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding">
                  <gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">
                    <input type="hidden" name="{@p1}" value="{{../../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}}}"/>
                  </gxsl:if>
                </gxsl:for-each>

                <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
                  <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
                  <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
                    <input type="hidden" name="{@property}" value="{{../../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}}}"/>
                  </gxsl:if>
                </gxsl:for-each>

                <gxsl:if test="@canprint='1'">
                  <script language="JavaScript" type="text/javascript">
                    <xsl:comment>
                      <![CDATA[
                        function openprintwindow()
                        {
                          var f=document.edit;
                          var path="?dp=print]]><gxsl:value-of select="@id_cvinclude"/><gxsl:for-each select="../CVIRBindings/CVIRBinding">&amp;<gxsl:value-of select="@p1"/>="+document.forms.action.<gxsl:value-of select="@p1"/>.value+"</gxsl:for-each><gxsl:for-each select="ancestor-or-self::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p1"/>="+document.forms.action.<gxsl:value-of select="@p1"/>.value+"</gxsl:if></gxsl:for-each><gxsl:for-each select="ancestor::CVInclude/Keys/Binding"><gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable><gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">&amp;<gxsl:value-of select="@property"/>="+document.forms.action.<gxsl:value-of select="@property"/>.value+"</gxsl:if></gxsl:for-each><gxsl:if test="@filterfirst='1'">&amp;<gxsl:value-of select="@concept"/>.filterfirst=0</gxsl:if><![CDATA[&style="+document.forms.action.printstyle.value+"&ssnctl=hdrext";
                          var sFeatures = "dependent=yes,toolbar=yes,scrollbars=yes,location=no,status=no,resizable=yes,height="+document.body.clientHeight+",width="+document.body.clientWidth+",top="+window.screenTop+",left="+window.screenLeft;
                          window.open(path,"external",sFeatures);
                        }
                      ]]>
                    //</xsl:comment>
                  </script>
                  &#160;&#160;&#160;
                  <font size="-1"><a href="javascript:openprintwindow();"><gxsl:value-of select="$dict/Text[@tid='openprint']/Value[@lang=$lang]"/>:</a>&#160;</font>
                  <select size="1" name="printstyle" class="input_filter">
                    <gxsl:choose>
                      <gxsl:when test="CVIStyles/CVIStyle[Style/StyleType/@name='print']">
                        <gxsl:for-each select="CVIStyles/CVIStyle[Style/StyleType/@name='print']">
                          <option>
                            <gxsl:attribute name="value"><gxsl:value-of select="position()"/></gxsl:attribute>
                            <gxsl:value-of select="Style/Name"/>
                          </option>
                        </gxsl:for-each>
                      </gxsl:when>
                      <gxsl:otherwise>
                        <option value="1">
                          Default
                        </option>
                      </gxsl:otherwise>
                    </gxsl:choose>
                  </select>
                </gxsl:if>
              </xsl:if>
              </nobr>
            </td>
          </tr>
        </table>
      </td>
    </tr>

    <tr cellspacing="0" cellpadding="0" style="margin : 0; padding : 0;">
      <th>
        <gxsl:if test="@create='1'">
          <xsl:if test="/DPOutput/@access!='r'">
            <xsl:call-template name="createButton">
              <xsl:with-param name="dpList" select=".."/>
              <xsl:with-param name="plusSign">1</xsl:with-param>
            </xsl:call-template>
          </xsl:if>
        </gxsl:if>
      </th>

      <gxsl:variable name="propprefix">
        <gxsl:choose>
          <gxsl:when test="@treelist='1' and name(..)='CView'">/<gxsl:value-of select="@concept"/>/</gxsl:when>
          <gxsl:otherwise></gxsl:otherwise>
        </gxsl:choose>
      </gxsl:variable>

      <gxsl:for-each select="CVIProperties/CVIProperty[@onlist='show']">


        <gxsl:choose>
          <gxsl:when test="CPStaticValues">
            <th>
              <xsl:variable name="fval"><xsl:value-of select="child::node()[@property='{$propprefix}{@name}']/@default"/></xsl:variable>
              <select size="1" name="{@formcode}" class="input_filter" style="width:100%" onkeypress="checkfiltersubmit(event)">
                <option value="">--- <gxsl:value-of select="$dict/Text[@tid='all_short']/Value[@lang=$lang]"/> ---</option>
                <gxsl:for-each select="CPStaticValues/CPStaticValue">
                  <option value='{statval}'>
                    <xsl:if test="$fval='{statval}'">
                      <xsl:attribute name="selected">yes</xsl:attribute>
                    </xsl:if>
                    <gxsl:value-of select="title"/>
                  </option>                    
                </gxsl:for-each>
              </select>
            </th>
          </gxsl:when>
          <gxsl:when test="not(RefProp)">
            <th>
            <gxsl:choose>
              <gxsl:when test="@type='boolean'">
                <select size="1" name="{@formcode}" class="input_filter" style="width:100%" onkeypress="checkfiltersubmit(event)">
                  <option value=""><gxsl:value-of select="$dict/Text[@tid='all_short']/Value[@lang=$lang]"/></option>
                  <option value="1">
                    <xsl:if test="child::node()[@property='{$propprefix}{@name}']/@default='1'">
                      <xsl:attribute name="selected">yes</xsl:attribute>
                    </xsl:if>
                    <gxsl:value-of select="$dict/Text[@tid='Yes']/Value[@lang=$lang]"/>
                  </option>
                  <option value="0">
                    <xsl:if test="child::node()[@property='{$propprefix}{@name}']/@default='0'">
                      <xsl:attribute name="selected">yes</xsl:attribute>
                    </xsl:if>
                    <gxsl:value-of select="$dict/Text[@tid='No']/Value[@lang=$lang]"/>
                  </option>
                </select>
              </gxsl:when>
              <gxsl:when test="@type='boolean_txt'">
                <select size="1" name="{@formcode}" class="input_filter" style="width:100%" onkeypress="checkfiltersubmit(event)">
                  <option value=""><gxsl:value-of select="$dict/Text[@tid='all_short']/Value[@lang=$lang]"/></option>
                  <option value="true">
                    <xsl:if test="child::node()[@property='{$propprefix}{@name}']/@default='true'">
                      <xsl:attribute name="selected">yes</xsl:attribute>
                    </xsl:if>
                    <gxsl:value-of select="$dict/Text[@tid='Yes']/Value[@lang=$lang]"/>
                  </option>
                  <option value="false">
                    <xsl:if test="child::node()[@property='{$propprefix}{@name}']/@default='false'">
                      <xsl:attribute name="selected">yes</xsl:attribute>
                    </xsl:if>
                    <gxsl:value-of select="$dict/Text[@tid='No']/Value[@lang=$lang]"/>
                  </option>
                </select>
              </gxsl:when>
              <gxsl:when test="@type='date' or @type='datetime' or @type='timestamp'">
                <xsl:variable name="fnode" select="child::node()[@nick='{$propprefix}{@name}_from']"/>
                <xsl:variable name="fval">
                  <xsl:choose>
                    <xsl:when test="name($fnode)='IsNull'">!</xsl:when>
                    <xsl:otherwise><xsl:value-of select="$fnode/@default"/></xsl:otherwise>
                  </xsl:choose>
                </xsl:variable>
                <nobr><input type="text" name="{@formcode}_from" value="{{$fval}}" size="8" class="input_filter" onfocus="setCurrentDate(this)" style="width:50%" onkeypress="checkfiltersubmit(event)"/><input type="text" name="{@formcode}_to" value="{{child::node()[@nick='{$propprefix}{@name}_to']/@default}}" size="8" class="input_filter" onfocus="setCurrentDate(this)" style="width:50%" onkeypress="checkfiltersubmit(event)"/></nobr>
              </gxsl:when>
              <gxsl:when test="@type='int' or @type='float'">
                <xsl:variable name="fnode" select="child::node()[@property='{$propprefix}{@name}']"/>
                <xsl:variable name="fval">
                  <xsl:choose>
                    <xsl:when test="name($fnode)='IsNull'">!</xsl:when>
                    <xsl:otherwise><xsl:value-of select="$fnode/@default"/></xsl:otherwise>
                  </xsl:choose>
                </xsl:variable>
                <input type="text" name="{@formcode}" value="{{$fval}}" size="8" class="input_filter" style="width:100%" onkeypress="checkfiltersubmit(event)"/>
              </gxsl:when>
              <gxsl:otherwise>
                <gxsl:variable name="len">
                  <gxsl:choose>
                    <gxsl:when test="number(@len)&gt;15">15</gxsl:when>
                    <gxsl:when test="number(@len)&gt;5 and number(@len)&lt;=15"><gxsl:value-of select="@len"/></gxsl:when>
                    <gxsl:otherwise>5</gxsl:otherwise>
                  </gxsl:choose>
                </gxsl:variable>
                <xsl:variable name="fnode" select="child::node()[@property='{$propprefix}{@name}']"/>
                <xsl:variable name="fval">
                  <xsl:choose>
                    <xsl:when test="name($fnode)='IsNull'">!</xsl:when>
                    <xsl:otherwise><xsl:value-of select="$fnode/@default"/></xsl:otherwise>
                  </xsl:choose>
                </xsl:variable>
                <input type="text" name="{@formcode}" value="{{$fval}}" size="{$len}" class="input_filter" onChange="setAstra(this)" style="width:100%" onkeypress="checkfiltersubmit(event)"/>

              </gxsl:otherwise>
            </gxsl:choose>
            </th>
          </gxsl:when>

          <gxsl:when test="@ref and @ref!='' and @fetchtype='direct'">
            <th>
              <select size="1" name="{@formcode}" class="input_filter" style="width:100%" onkeypress="checkfiltersubmit(event)">
              <option value=""><gxsl:value-of select="$dict/Text[@tid='all_short']/Value[@lang=$lang]"/></option>
              <xsl:for-each select="../Opts/{@refconceptcoll}/{@refconcept}">
                <option>
                  <gxsl:choose>
                    <gxsl:when test="@attr='1'">
                      <xsl:attribute name="value"><xsl:value-of select="@{@refproplow}"/></xsl:attribute>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <xsl:attribute name="value"><xsl:value-of select="{@refprop}"/></xsl:attribute>
                    </gxsl:otherwise>
                  </gxsl:choose>
                  <gxsl:choose>
                    <gxsl:when test="@attr='1'">
                      <xsl:if test="@{@refproplow}=../../../DPFilter/child::node()[@property='{$propprefix}{@name}']/@default">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <xsl:if test="{@refprop}=../../../DPFilter/child::node()[@property='{$propprefix}{@name}']/@default">
                        <xsl:attribute name="selected">yes</xsl:attribute>
                      </xsl:if>
                    </gxsl:otherwise>
                  </gxsl:choose>

                  <gxsl:choose>
                    <gxsl:when test="RefProp">
                      <gxsl:for-each select="RefProp">
                        <gxsl:choose>
                          <gxsl:when test="@attr='1'">
                            <gxsl:if test="position()!=1"><xsl:if test="@{@lowcode} and @{@lowcode}!=''">,&#160;</xsl:if></gxsl:if>
                            <xsl:value-of select="@{@lowcode}"/>
                          </gxsl:when>
                          <gxsl:otherwise>
                            <gxsl:if test="position()!=1"><xsl:if test="{@code} and {@code}!=''">,&#160;</xsl:if></gxsl:if>
                            <xsl:value-of select="{@code}"/>
                          </gxsl:otherwise>
                        </gxsl:choose>
                      </gxsl:for-each>
                    </gxsl:when>
                    <gxsl:otherwise>
                      <xsl:value-of select="@{@refproplow}"/>
                    </gxsl:otherwise>
                  </gxsl:choose>
                </option>
              </xsl:for-each>
            </select>
            </th>
          </gxsl:when>

          <gxsl:otherwise>
            <gxsl:if test="@onedit='show' and @key='0'"><th> </th></gxsl:if>
            <gxsl:for-each select="RefProp">
              <th>
              <gxsl:variable name="rptitle">
                <gxsl:choose>
                  <gxsl:when test="last()>1"><gxsl:value-of select="../Title"/>: <gxsl:value-of select="Title"/></gxsl:when>
                  <gxsl:otherwise><gxsl:value-of select="../Title"/></gxsl:otherwise>
                </gxsl:choose>
              </gxsl:variable>

              <gxsl:choose>
                <gxsl:when test="@type='date' or @type='datetime' or @type='timestamp'">
                  <xsl:variable name="fnode" select="child::node()[@nick='{../@nickname}.{@refconcept}/{@code}_from']"/>
                  <xsl:variable name="fval">
                    <xsl:choose>
                      <xsl:when test="name($fnode)='IsNull'">!</xsl:when>
                      <xsl:otherwise><xsl:value-of select="$fnode/@default"/></xsl:otherwise>
                    </xsl:choose>
                  </xsl:variable>
                  <nobr><input type="text" name="{../@formcode}{@formcode}_from" value="{{$fval}}" size="8" class="input_filter" onfocus="setCurrentDate(this)" style="width:50%" onkeypress="checkfiltersubmit(event)"/><input type="text" name="{../@formcode}{@formcode}_to" value="{{child::node()[@nick='{../@nickname}.{@refconcept}/{@code}_to']/@default}}" size="8" class="input_filter" onfocus="setCurrentDate(this)" style="width:50%" onkeypress="checkfiltersubmit(event)"/></nobr>
                </gxsl:when>
                <gxsl:when test="@type='int' or @type='float'">
                  <xsl:variable name="fnode" select="child::node()[@property='{../@nickname}.{@refconcept}/{@code}']"/>
                  <xsl:variable name="fval">
                    <xsl:choose>
                      <xsl:when test="name($fnode)='IsNull'">!</xsl:when>
                      <xsl:otherwise><xsl:value-of select="$fnode/@default"/></xsl:otherwise>
                    </xsl:choose>
                  </xsl:variable>
                  <input type="text" name="{../@formcode}{@formcode}" value="{{$fval}}" size="8" class="input_filter" style="width:100%" onkeypress="checkfiltersubmit(event)"/>
                </gxsl:when>
                <gxsl:otherwise>
                  <gxsl:variable name="len">
                    <gxsl:choose>
                      <gxsl:when test="number(@len)&gt;15">15</gxsl:when>
                      <gxsl:when test="number(@len)&gt;5 and number(@len)&lt;=15"><gxsl:value-of select="@len"/></gxsl:when>
                      <gxsl:otherwise>5</gxsl:otherwise>
                    </gxsl:choose>
                  </gxsl:variable>
                  <xsl:variable name="fnode" select="child::node()[@property='{../@nickname}.{@refconcept}/{@code}']"/>
                  <xsl:variable name="fval">
                    <xsl:choose>
                      <xsl:when test="name($fnode)='IsNull'">!</xsl:when>
                      <xsl:otherwise><xsl:value-of select="$fnode/@default"/></xsl:otherwise>
                    </xsl:choose>
                  </xsl:variable>
                  <input type="text" name="{../@formcode}{@formcode}" value="{{$fval}}" size="{$len}" class="input_filter" onChange="setAstra(this)" style="width:100%" onkeypress="checkfiltersubmit(event)"/>

                </gxsl:otherwise>
              </gxsl:choose>
              </th>
            </gxsl:for-each>
          </gxsl:otherwise>
        </gxsl:choose>
      </gxsl:for-each>

      <xsl:if test="/DPOutput/DPList/@filterfirst!='1'">
        <th valign="center">
          <xsl:attribute name="colspan"><xsl:value-of select="$othercols"/></xsl:attribute>
          <gxsl:if test="@update='1'">
            <xsl:if test="/DPOutput/@access!='r'">
              <input type="button" name="apply" onclick="compute();" disabled="true" class="input_filter"><gxsl:attribute name="value"><gxsl:value-of select="$dict/Text[@tid='cfm_changes']/Value[@lang=$lang]"/></gxsl:attribute></input>
            </xsl:if>
          </gxsl:if>
        </th>
      </xsl:if>

    </tr>
  </xsl:template>

  <xsl:template name="createButton">
    <xsl:param name="dpList"/>
    <xsl:param name="plusSign">0</xsl:param>

    <xsl:if test="$dpList/DPPage/@total!='{@required}' or (not($dpList/DPPage) and count({@conceptcoll}/{@concept})!='{@required}')">
      <a>
        <xsl:attribute name="href">?dp=create<gxsl:value-of select="@id_cvinclude"/>
          <gxsl:for-each select="../CVIRBindings/CVIRBinding">&amp;<gxsl:value-of select="@p2"/>=<xsl:value-of select="$dpList/../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:for-each>
          <gxsl:for-each select="ancestor::CVInclude/../CVIRBindings/CVIRBinding"><gxsl:if test="not(../../CVInclude/Keys/Binding[@property=current()/@p2])">&amp;<gxsl:value-of select="@p2"/>=<xsl:value-of select="$dpList/../DPNavig/{../../../../@conceptcoll}/{../../../../@concept}/@{@p1low}"/></gxsl:if></gxsl:for-each>
          <gxsl:for-each select="ancestor::CVInclude/Keys/Binding">
            <gxsl:variable name="property"><gxsl:value-of select="@property"/></gxsl:variable>
            <gxsl:if test="not(../../CVIRels/CVIRel[descendant-or-self::CVInclude/@id_cvinclude=$cvinclude/@id_cvinclude]/CVIRBindings/CVIRBinding[@p1=$property])">
              <xsl:text>&amp;<gxsl:value-of select="@property"/>=</xsl:text><xsl:value-of select="$dpList/../DPNavig/{../../@conceptcoll}/{../../@concept}/@{@propertylow}"/>
            </gxsl:if>
          </gxsl:for-each>
        </xsl:attribute>

        <gxsl:variable name="btntitle">
          <gxsl:choose>
            <gxsl:when test="CVITitles/CVITitle and CVITitles/CVITitle[@id_cttype='createbutton']/Title">
              <gxsl:value-of select="CVITitles/CVITitle[@id_cttype='createbutton']/Title"/>
            </gxsl:when>
            <gxsl:otherwise>
              <gxsl:value-of select="$dict/Text[@tid='crt']/Value[@lang=$lang]"/>
            </gxsl:otherwise>
          </gxsl:choose>
        </gxsl:variable>

        <xsl:choose>
          <xsl:when test="$plusSign='1'">
            <xsl:attribute name="title">
              <gxsl:value-of select="$btntitle"/>
            </xsl:attribute>
            <xsl:text>+</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <gxsl:value-of select="$btntitle"/>
          </xsl:otherwise>
        </xsl:choose>
      </a>
    </xsl:if>
  </xsl:template>

  </gxsl:template>

</gxsl:stylesheet>
